1
私のアプリの通知のために「直接返信」を実装しました。 複数の直接返信を実装するにはどうすればよいですか?複数のグループを持つAndroidの通知
たとえば、ユーザーが2人の異なるユーザーからメッセージを受け取った場合、そのユーザーが通知を通じてそれぞれのユーザーに返信できるようにします。
notificationBuilder.setContentTitle(title)
.setContentText(text);
NotificationCompat.InboxStyle expandedStyle = new NotificationCompat.InboxStyle();
expandedStyle.setBigContentTitle(title);
for (String key : mMessageList.keySet()) {
for (String message : mMessageList.get(key)) {
expandedStyle.addLine(message);
}
}
expandedStyle.setSummaryText(summary);
notificationBuilder.setStyle(expandedStyle);
String replyLabel = context.getString(R.string.reply_to, name);
RemoteInput remoteInput = new RemoteInput.Builder(KEY_TEXT_REPLY)
.setLabel(replyLabel)
.build();
NotificationCompat.Action replyAction = new NotificationCompat.Action.Builder(
R.drawable.reply, replyLabel, getReplyPendingIntent(context))
.addRemoteInput(remoteInput)
.build();
notificationBuilder.addAction(replyAction);
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(NOTIFICATION_ID, notificationBuilder.build());
[こちら](https://stackoverflow.com/questions/37539297/how-to-display-multiple-notification-as-a-group)をチェックすると、複数の通知を作成する方法が示されます。 –