草庐IT

setGroup

全部标签

android - Notification.Builder 中 setGroup() 的用途是什么?

我在理解setGroup()的目标时遇到了一些麻烦方法。正如文档所说:...Groupednotificationsmaydisplayinaclusterorstackondeviceswhichsupportsuchrendering....这是第一个问题:这是什么效果图?它有什么特别之处?!我创建了一个显示自定义文本消息的方法:publicstaticvoidshowNotification(Contextcontext,Stringtitle,Stringmessage,PendingIntentpendingIntent){notificationMessages.add(m

android - 使用 setGroup() 的 Kitkat(API 19)中的堆栈通知不起作用

我有一个找不到答案的问题。我试过AndroidDeveloper教程,我在stackoverflow和谷歌上搜索过,但要么我的搜索技能太棒了,要么我认为没有答案可以解决我的问题。当有多个消息时,我想将所有新消息的消息通知堆叠为一个通知。我可以为每条消息显示一个通知,但我不能进行堆栈/摘要通知。我得到的最好的是:http://developer.android.com/images/android-5.0/notifications/Summarise_Dont.png我想要的是:http://developer.android.com/images/android-5.0/notifi

Android - NotificationCompat.Builder 堆叠通知与 setGroup(group) 不工作

我想使用setGroup堆叠通知(如此处所述:https://developer.android.com/training/wearables/notifications/stacks.html)基本上,我使用0作为通知ID(始终相同)和builder.setGroup("test_group_key")但新通知总是会替换前一个通知。可能是什么问题?代码:publicBasicNotifier(Contextcontext){super(context);notifManager=(NotificationManager)context.getSystemService(Context

android - 通知中的 setgroup() 不起作用

我正在尝试创建通知组,这是我的代码://Buildthenotification,settingthegroupappropriatelyNotificationnotif=newNotificationCompat.Builder(getApplicationContext()).setContentTitle("Newmailfrom"+1).setContentText("cv").setSmallIcon(R.drawable.rh_logo).setStyle(newNotificationCompat.InboxStyle().addLine("AlexFaaborgChe

java - 在 Android KitKat 中调用 setGroup() 时未显示通知

我正在测试可堆叠通知(StackingNotificationsarticle).我检测到在某些情况下,在运行android4.XKitKat的设备中调用notify()后通知不会显示。为了简单的问题,我创建了这段代码来模拟通知(button1)和带有摘要的第二个通知(button2)privatefinalstaticintNOTIFICATION_ID_A=6;privatefinalstaticintNOTIFICATION_ID_B=7;privatefinalstaticintNOTIFICATION_ID_SUMMARY=8;@Overrideprotectedvoidon