Problems with notification

I have developed an application that shows a notification when a new update is received from the server.

When an update comes from the server, I can see the generated new notification in the device notification area.

The problem I'm running into is that the notification time is updated every time it is shown.

  • Is there a way to know if there is already an App Notification?
  • I want to restore a notification if it doesn't exist

I did R&D but didn't get any way to get the existing notifications that are in the notification area of ​​the device.

+3


source to share


2 answers


To set up a notification so that it can be updated, enter it with the notification ID by calling NotificationManager.notify(ID, notification).



To update this notification after it is released, update or create an object NotificationCompat.Builder

, create an object from it, Notification

and enter Notification

with the same ID you used earlier.

+2


source


ISsue noficcation id ... you get notifications with different id ...

if you do like this:



NotificationManager.notify(3000, notification);

      

and when you call the same method again, you will not get another notification.

0


source







All Articles