Я пытаюсь создать уведомление с несколькими линиями, как это делает приложение Gmail, как показано на изображении ниже (5 уведомлений, сгруппированных под одним уведомлением)
Я пробовал различные примеры, но могу только создавать одиночные уведомления типа
public void createSingleNotification(String title, String messageText, String tickerttext) {
int icon = R.drawable.notification_icon; // icon from resources
CharSequence tickerText = tickerttext; // ticker-text
long when = System.currentTimeMillis(); // notification time
Context context = getApplicationContext(); // application Context
CharSequence contentTitle = title; // expanded message title
CharSequence contentText = messageText; // expanded message text
Intent notificationIntent = new Intent(this, MainActivity.class);
Bundle xtra = new Bundle();
xtra.putString("title", title);
xtra.putString("message", messageText);
notificationIntent.putExtras(xtra);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
notificationIntent, PendingIntent.FLAG_ONE_SHOT
+ PendingIntent.FLAG_UPDATE_CURRENT);
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
Notification notification = new Notification(icon, tickerText, when);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
notification.defaults |= Notification.DEFAULT_LIGHTS;
notification.defaults |= Notification.DEFAULT_SOUND;
notification.defaults |= Notification.FLAG_AUTO_CANCEL;
notification.flags = Notification.DEFAULT_LIGHTS
| Notification.FLAG_AUTO_CANCEL;
final int HELLO_ID = 0;
mNotificationManager.notify(HELLO_ID, notification);
}
Я не уверен, как создать группу уведомлений, в которую я могу добавить строки.