Adil Mahmud Choudhury Adil Mahmud Choudhury - 1 year ago 76
Android Question

Notification Not showing

Case study: I need a program that will add a notification at android. And when someone click on the notification it should lead them to my second activity.

I have established a code. The notification should be working, but for some reason it is not working. The

isn't showing at all. Dont know what am i missing.

Code of those files:

Notification n = new Notification.Builder(this)
.setContentTitle("New mail from " + "")
.setStyle(new Notification.BigTextStyle().bigText(longText))

NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
// Hide the notification after its selected

notificationManager.notify(0, n);

Answer Source

As @dmmh said the code wont work without and icon. So after modifying the code with


the project run perfectly.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download