Adil Mahmud Choudhury Adil Mahmud Choudhury - 1 month ago 12
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);


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


the project run perfectly.