最多8个捆绑通知?
我正在编写一个应用程序,根据用户设置的警报,在特定时间在状态栏(和通知窗口)中显示通知 .
每当发出3个或更多通知时,操作系统将它们捆绑在一起 . 到现在为止还挺好 .
但似乎我的应用程序在通知窗口中始终有8个通知的最大限制 . 如果我发出第九个通知,则“最早的”通知会从该组中消失,并且会出现第九个通知 .
我已经在2款摩托罗拉手机上测试了这款应用程序(似乎是)香草Android 6.0和7.0 . 问题发生在7.0(引入捆绑通知时) . 这是生成通知的代码:
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
.setContentIntent(pendingIntentPopup)
.setSmallIcon(R.drawable.q_statusbar_icon)
.setCustomContentView(contentView) //my notifications have a custom layout
.setSound(notificationSoundUri)
.setVibrate(vibrate_pattern);
Notification notification = mBuilder.build();
notification.flags |= Notification.FLAG_NO_CLEAR;
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(id, notification);
不幸的是,有时会在通知窗口(捆绑在一起)中超过8个通知应“活动” . 这有解决方法吗?我错过了什么吗?