4

I am having troubles with NotificationCompat v7 and Android O. Since the implementation of the NotificationCompatV7 only implements the deprecated constructor ( was deprecated in support library 26.0.0-beta1) of the v4 version, I am not able to get Notifications to work.

Solution for NotificationCompat v4 was proposed here: NotificationCompat with API 26

but since there is this issue with the poor implementation of the v7 version (https://issuetracker.google.com/issues/62475846) I am not able to post notifications on Android O

Does anybody have a solution for this or am I missing something here?

Mike T
  • 1,194
  • 14
  • 25

1 Answers1

9

NotificationCompat v7 is now deprecated, you should use NotificationCompat v4 (according to the comments on NotificationCompat v7 class ).

/**
 * @deprecated Use the static classes in {@link android.support.v4.app.NotificationCompat}.
 */

Then you can build your notification (Kotlin):

val notificationBuilder = NotificationCompat.Builder(context, "your_notification_channel_name")                     
.setContentTitle("title")
[...]

Note: the latest support version is "com.android.support:appcompat-v7:26.0.0"

Punpuf
  • 2,042
  • 1
  • 19
  • 30
  • Thank you for the response. 26.0.0 really got rid of my issues with the NotificationCompat.Builder from the support library beta release. – Mike T Jul 25 '17 at 13:44