Reputation: 105
Currently, I receive notifications from a server. What happens is, if I get a notification, I dont see it for long time. When a new notification comes, I lose the previous one. I want a single notification with multiple messages something like this -
Upvotes: 1
Views: 1049
Reputation: 35539
It is InboxStyle notification
Notification notif = new Notification.Builder(mContext)
.setContentTitle("5 New mails from " + sender.toString())
.setContentText(subject)
.setSmallIcon(R.drawable.new_mail)
.setLargeIcon(aBitmap)
.setStyle(new Notification.InboxStyle()
.addLine(str1)
.addLine(str2)
.setContentTitle("")
.setSummaryText("+3 more"))
.build();
Here is official document
check this example also - Inbox Style Notification Like Whatsapp
Upvotes: 3