Verify that Notification is active

1

I need to identify if a Notification specifies (ID Notification) is still active in the Android notifications list.

Status: I have a method that cancels Notification so far everything is working correctly, however, I need to cancel a notification when I cancel the notification. CountDownTimer (At this point everything is working correctly).

Who can help me thank you.

Att.

    
asked by anonymous 11.02.2016 / 20:03

1 answer

1

As far as I know, this is only possible from the API18 by implementing a NotificationListenerService or from API23 using the getActiveNotifications () of the NotificationManager.

Implement a NotificationListenerService it's too costly just to know if a notification is on the list.

Knowing when it is presented is easy, since it is you who launches it. To find out if it has been canceled use the setDeleteIntent () to indicate a PendingIntent that will be thrown when the user cancels.

If it was launched and you did not cancel it then it is on the list.

    
12.02.2016 / 00:18