Reputation: 99
Is there a way to get the list of notifications of my app?
I need to list them and let the user to delete them one by one, but I can't find a way.
Upvotes: 0
Views: 511
Reputation: 2633
I don't believe that you can list your notifications that have been shown. If the user wants to clear a notification from the app then all they need to do is pull the notification draw down and swipe it away. You can have your app cancel a notification using the NotificationManager by supplying the id of your notification to the cancel method.
If the use clicks the notification you then have two options for clearing.
1) When creating the notification you can call Notification#setAutoCancel(true)
and the notification will be automatically cleared when the user taps on it.
2) Pass the notification id as part of the PendingIntent with the notification then you can use this to cancel the notification when the user taps on it.
Upvotes: 1