public static final class NotificationCompat.MessagingStyle.Message extends Object
Constructor and Description |
---|
Message(CharSequence text,
long timestamp,
CharSequence sender)
Constructor
|
Modifier and Type | Method and Description |
---|---|
String |
getDataMimeType()
Get the MIME type of the data pointed to by the Uri
|
Uri |
getDataUri()
Get the the Uri pointing to the content of the message.
|
CharSequence |
getSender()
Get the text used to display the contact's name in the messaging experience
|
CharSequence |
getText()
Get the text to be used for this message, or the fallback text if a type and content
Uri have been set
|
long |
getTimestamp()
Get the time at which this message arrived
|
NotificationCompat.MessagingStyle.Message |
setData(String dataMimeType,
Uri dataUri)
Sets a binary blob of data and an associated MIME type for a message.
|
public Message(CharSequence text, long timestamp, CharSequence sender)
text
- A CharSequence
to be displayed as the message contenttimestamp
- Time at which the message arrivedsender
- 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 NotificationCompat.MessagingStyle.getUserDisplayName()
.
Should be unique amongst all individuals in the conversation, and should be
consistent during re-posts of the notification.public NotificationCompat.MessagingStyle.Message setData(String dataMimeType, Uri dataUri)
dataMimeType
- The MIME type of the content. See
for the list of supported MIME
types on Android and Android Wear.dataUri
- The uri containing the content whose type is given by the MIME type.
public CharSequence getText()
public long getTimestamp()
public CharSequence getSender()
public String getDataMimeType()