0

I am facing some problem with Notification in Android - O. I am trying to display Notification in android O. Some how my app is not displaying any notification even after using a notification channel.

My is here

Any suggestion or help?

  • https://stackoverflow.com/questions/43093260/notification-not-showing-in-android-o – IntelliJ Amiya Aug 30 '17 at 06:37
  • 1
    Possible duplicate of [Notification not showing in Android O](https://stackoverflow.com/questions/43093260/notification-not-showing-in-android-o) – Divy Soni Aug 30 '17 at 06:43
  • tried it. I have already created a channel as mentioned in Documentation. It is working fine in the previous version of Android but not in Android-O. – CrazyProgrammerThing Aug 30 '17 at 06:52
  • @DivySoni According to documentation we are supposed to use NotificationCompat.Builder(Context, String) because NotificationCompat.Builder (Context context) constructor was deprecated in API level 26.0.0. but the android studio is showing me an incorrect argument error – CrazyProgrammerThing Aug 30 '17 at 07:29
  • Notification.Builder build = new Notification.Builder(MainActivity.this, CHANNEL_ID) .setContentTitle("You have been notify") .setContentText("This is your Notifiaction Text") .setSmallIcon(R.drawable.ic_stat_name) .setChannelId(CHANNEL_ID) .setDefaults(NotificationCompat.DEFAULT_ALL) .setContentIntent(notificationPendingIntent); this is working fine @DivySoni i guess it supposed to be Notification.Builder(Context context, String ChannelID) – CrazyProgrammerThing Aug 30 '17 at 08:00

0 Answers0