在Android N中看不到setGroupSummary(true)的通知

Sri*_*san 8 performance notifications android android-studio

试图以群集格式显示3个通知.根据文档,我为第一个通知添加了setGroupSummary(true)属性.但是在结果中我只有两个通知.添加GroupSummary属性的通知不可见.

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");
Run Code Online (Sandbox Code Playgroud)

这里是通知触发器,

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

结果是,在此输入图像描述

我想以群集格式显示所有三个通知而不会遗漏.

任何帮助将非常感激.

Lin*_*ton 0

Android 7 会自行做出有关摘要通知的决定。因此,您希望看到它,除非系统决定需要显示它。

解决方案:创建专门的摘要通知。