added in API level 24
Summary:
Nested Classes
| Constants
| Inherited Fields
| Ctors
| Methods
| Inherited Methods
| [Expand All]
Notification.MessagingStyle
public
static
class
Notification.MessagingStyle
extends Notification.Style
| java.lang.Object | ||
| ↳ | android.app.Notification.Style | |
| ↳ | android.app.Notification.MessagingStyle | |
Helper class for generating large-format notifications that include multiple back-and-forth
messages of varying types between any number of people.
If the platform does not provide large-format notifications, this method has no effect. The
user will always see the normal notification view.
This class is a "rebuilder": It attaches to a Builder object and modifies its behavior, like
so:
Notification noti = new Notification.Builder()
.setContentTitle("2 new messages wtih " + sender.toString())
.setContentText(subject)
.setSmallIcon(R.drawable.new_message)
.setLargeIcon(aBitmap)
.setStyle(new Notification.MessagingStyle(resources.getString(R.string.reply_name))
.addMessage(messages[0].getText(), messages[0].getTime(), messages[0].getSender())
.addMessage(messages[1].getText(), messages[1].getTime(), messages[1].getSender()))
.build();