下面是 Facebook 应用程序的设置屏幕。在我的应用程序中,它显示“类别”,这里是“Kalis Martinez”。我想在我的应用程序中实现这一点。
我的应用程序显示如下:
我正在做的如下。
NotificationManager manager = (NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
manager.createNotificationChannelGroup(new
NotificationChannelGroup(groupId, groupName));
String GROUP_KEY_WORK_EMAIL = "com.android.example.WORK_EMAIL";
Notification notification = new Notification.Builder(getApplicationContext(), SECONDARY_CHANNEL)
.setContentTitle(title)
.setContentText(body)
//build summary info into InboxStyle template
.setStyle(new Notification.InboxStyle()
.addLine("Alex Faarborg Check this out")
.addLine("Jeff Chang Launch Party")
.setBigContentTitle("2 new messages")
.setSummaryText("janedoe@example.com"))
//specify which group this notification belongs to
.setGroup(GROUP_KEY_WORK_EMAIL)
//set this notification as the summary for the group
.setGroupSummary(true)
.setSmallIcon(getSmallIcon())
.setAutoCancel(true);
manager.notify(id, notification.build());
setGroup()并setGroupSummary()在系统托盘中显示通知时进行分组。
如何更改该标签?

