In my application come push notifications. They are displayed in the status bar. But each new notification replaces the old one. I would like them to be divided into types. For example, let all notifications for comments replace each other, and notifications, for example, about likes, let them replace only notifications about likes, but do not go into notifications about comments. How to implement this?
1 answer
Each Notification has an ID that you assign when creating and displaying it. You need to implement the logic just in this place and assign different ID names to the notifications.
- Yes, while waiting for a response, I myself have already found) NotificationManager notificationManager = (NotificationManager) getSystemService (Context.NOTIFICATION_SERVICE); notificationManager.notify (push_id, noBuilder.build ()); - this push_id is exactly that ID). But thanks for the reply. - cheerful_weasel
|