pocketDev
pocketDev

Reputation: 205

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.

Upvotes: 12

Views: 7321

Answers (1)

Octavian Helm
Octavian Helm

Reputation: 39604

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

Upvotes: 23

Related Questions