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?
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With