Search code examples
androidandroid-notificationsandroid-statusbar

Recognize when a notification posted / removed is in a group


I'm trying to play with NotificationListenerService for check if StatusBarNotifications (displayed in StatusBar) are inherent to a group (ex. mails or messages). I'm using sdk >= 21.

Playing with applications well-known like fb, whatsapp or gmail I saw different rules for marking grouped messages (group and key properties - of StatusBarNotification - are not so easy to manage for this purpose).

How is possible recognize when a notification posted / removed is in a group? and which is the group header?


Solution

  • There isn't the possibility to achieve this only with StatusBarNotification. But is possible to do something with onNotificationRemoved/Posted & getActiveNotifications.