Skip to content Skip to sidebar Skip to footer

Notification Alert Is Shown Only For The First Message

I have the following method for showing notifications: private void sendNotification(String msg) { mNotificationManager = (NotificationManager) _context.get

Solution 1:

For example, you can cancel old notification and display a new one with another id. It will look like this:

mNotificationManager.cancel(notificationId);
mNotificationManager.notify(notificationId++, notification);

Update by @breceivemail:

It works correctly if you put ++ before notificationId like this:

 mNotificationManager.cancel(notificationId);
 mNotificationManager.notify(++notificationId, notification);

Thanks,

Post a Comment for "Notification Alert Is Shown Only For The First Message"