I have created a notification and added a PendingIntent
so that the notification is closed when the notification is selected in expanded view.
My problem is that when the user clicks the Clear
button to remove all notifications I am not notified and I need to perform some cleanup when my notification is killed.
FLAG_NO_CLEAR
would enable me to ignore the Clear
button and keep my notification but I'd prefer to have my Intent
triggered correctly to allow cleanup.
Swipe up from the homescreen and open Settings (the one with a gear icon). Scroll to Notifications. Open Advanced settings from the following menu. Select Notification history.
To remove a persistent notification on Android as fast as possible, first, press-and-hold on it. Alternatively, swipe the notification left or right to reveal a gear icon on either side, and then tap on it. The notification expands. Tap on “Turn off notifications” at the bottom.
It seems like you are looking for the deleteIntent field of the Notification
class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With