Each notification has an ID and can also be canceled. Every time you send a new notification, cancel the old notification, so that there is only one notification icon on the notification bar.
When NotificationManager calls notify, one parameter is id. If the ids are the same, only one will be displayed (the latter one will update the previous one). If the ids are different, multiple ones will be displayed.
Just use the same id, but then the previous notification will be replaced. With the concept of group notification in Android N, your problem will be easily solved.
Each notification has an ID and can also be canceled.
Every time you send a new notification, cancel the old notification, so that there is only one notification icon on the notification bar.
When NotificationManager calls notify, one parameter is id. If the ids are the same, only one will be displayed (the latter one will update the previous one). If the ids are different, multiple ones will be displayed.
Just use the same id, but then the previous notification will be replaced. With the concept of group notification in Android N, your problem will be easily solved.