Helper class for generating large-format notifications that include multiple back-and-forth
messages of varying types between any number of people.
In order to get a backwards compatible behavior, the app needs to use the v7 version of the
notification builder together with this style, otherwise the user will see the normal
Use setConversationTitle(CharSequence) to set a conversation title for
group chats with more than two people. This could be the user-created name of the group or,
if it doesn't have a specific name, a list of the participants in the conversation. Do not
set a conversation title for one-on-one chats, since platforms use the existence of this
field as a hint that the conversation is a group.
This class is a "rebuilder": It attaches to a Builder object and modifies its behavior, like
Notification notification = new Notification.Builder()
.setContentTitle("2 new messages with " + sender.toString())
.addMessage(messages.getText(), messages.getTime(), messages.getSender())
.addMessage(messages.getText(), messages.getTime(), messages.getSender()))
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
CharSequence: Required - the name to be displayed for any replies sent by the
user before the posting app reposts the notification with those messages after they've
been actually sent and in previous messages sent by the user added in
CharSequence: A CharSequence to be displayed as the message content
long: Time at which the message arrived in ms since Unix epoch
CharSequence: A CharSequence to be used for displaying the name of the
sender. Should be null for messages by the current user, in which case
the platform will insert getUserDisplayName().
Should be unique amongst all individuals in the conversation, and should be
consistent during re-posts of the notification.