Tried to show 3 notification in cluster format. As per the doc, I added the setGroupSummary(true) property for the first notification.But in the result i have got only two notification. The notification which is added the GroupSummary property is not visible.
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 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 is,
I want to show all three notification in the cluster format without missing.
Any help will be really appreciated.
To create a stack, call setGroup() for each notification you want in the stack and specify a group key. Then call notify() to send it to the wearable. final static String GROUP_KEY_EMAILS = "group_key_emails"; // Build the notification, setting the group appropriately Notification notif = new NotificationCompat.
In this class, clicking the button calls the addNotification() method where we implement the NotificationCompat. Builder object to set the notification properties. The NotificationManager. notify() method is used to display the notification.
You should check the following answer : setgroup() in notification not working
You have to create a separate group notification and set the group summary flag true only for that, and that becomes the parent notification that bundles other notifications with the same group key within itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With