Notification using setGroupSummary (true) does not appear in Android N

I tried to show 3 notifications in cluster format. According to the document, I added the setGroupSummary (true) property for the first notification. But as a result, I have only two notifications. The notification to which the GroupSummary property is added is not displayed.

NotificationCompat.Builder firstNotification = createNotification(context,"1.Message","Here you go 1"); firstNotification .setGroupSummary(true); firstNotification .setGroup("KEY_NOTIFICATION_GROUP"); NotificationCompat.Builder secondNotifi = createNotification(context,"2.Message","Here you go 2"); secondNotifi .setGroup("KEY_NOTIFICATION_GROUP"); NotificationCompat.Builder thirdNotifi= createNotification(context,"3.Message","Here you go 3"); thirdNotifi.setGroup("KEY_NOTIFICATION_GROUP"); 

Here's the notification trigger,

 notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(0,firstNotification .build()); notificationManager.notify(1,secondNotifi .build()); notificationManager.notify(2,thirdNotifi.build()); 

And the result: enter image description here

I want to show all three notifications in cluster format without gaps.

Any help would be really appreciated.

+7
performance android android-studio notifications
source share
2 answers

You should check the following answer: setgroup () in the notification does not work

You need to create a separate group notification and set the summary group flag just for this, and this will become the parent notification that associates other notifications with the same group key within itself.

+1
source share

Android 7 decides on a summary notification. Thus, you want to see it if the system does not decide that it should be displayed.

Solution: Create a custom summary notification.

0
source share

All Articles