Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know when my notification is cleared via Clear button?

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.

like image 911
pocketDev Avatar asked Jan 12 '11 09:01

pocketDev


People also ask

How do I check my notification history?

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.

How do I clear notifications that won't go away?

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.


1 Answers

It seems like you are looking for the deleteIntent field of the Notification class.

like image 120
Octavian A. Damiean Avatar answered Nov 15 '22 18:11

Octavian A. Damiean