# Print output for @column tags ?>
public
static
final
class
Notification.MessagingStyle.Message
extends Object
java.lang.Object | |
↳ | android.app.Notification.MessagingStyle.Message |
Public constructors | |
---|---|
Message(CharSequence text, long timestamp, CharSequence sender)
This constructor is deprecated.
use |
|
Message(CharSequence text, long timestamp, Person sender)
Constructor |
Public methods | |
---|---|
String
|
getDataMimeType()
Get the MIME type of the data pointed to by the Uri |
Uri
|
getDataUri()
Get the Uri pointing to the content of the message. |
Bundle
|
getExtras()
Get the extras Bundle for this message. |
static
List<Notification.MessagingStyle.Message>
|
getMessagesFromBundleArray(Parcelable[] bundles)
Returns a list of messages read from the given bundle list, e.g. |
CharSequence
|
getSender()
This method is deprecated.
use |
Person
|
getSenderPerson()
Get the sender associated with this message. |
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 |
Notification.MessagingStyle.Message
|
setData(String dataMimeType, Uri dataUri)
Sets a binary blob of data and an associated MIME type for a message. |
Inherited methods | |
---|---|
public Message (CharSequence text, long timestamp, CharSequence sender)
This constructor is deprecated.
use Message(CharSequence, long, Person)
Constructor
Parameters | |
---|---|
text |
CharSequence : A CharSequence to be displayed as the message content |
timestamp |
long : Time at which the message arrived |
sender |
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 MessagingStyle#getUserDisplayName() .
Should be unique amongst all individuals in the conversation, and should be
consistent during re-posts of the notification. |
public Message (CharSequence text, long timestamp, Person sender)
Constructor
Parameters | |
---|---|
text |
CharSequence : A CharSequence to be displayed as the message content
This value cannot be null . |
timestamp |
long : Time at which the message arrived |
sender |
Person : The Person who sent the message.
Should be null for messages by the current user, in which case
the platform will insert the user set in MessagingStyle(Person) .
The person provided should contain an Icon, set with
null . |
public String getDataMimeType ()
Get the MIME type of the data pointed to by the Uri
Returns | |
---|---|
String |
public Uri getDataUri ()
Get the Uri pointing to the content of the message. Can be null, in which case is used.
Returns | |
---|---|
Uri |
See also:
public static List<Notification.MessagingStyle.Message> getMessagesFromBundleArray (Parcelable[] bundles)
Returns a list of messages read from the given bundle list, e.g.
Notification.EXTRA_MESSAGES
or Notification.EXTRA_HISTORIC_MESSAGES
.
Parameters | |
---|---|
bundles |
Parcelable : This value may be null . |
Returns | |
---|---|
List<Notification.MessagingStyle.Message> |
This value cannot be null . |
public CharSequence getSender ()
This method is deprecated.
use getSenderPerson()
Get the text used to display the contact's name in the messaging experience
Returns | |
---|---|
CharSequence |
public Person getSenderPerson ()
Get the sender associated with this message.
Returns | |
---|---|
Person |
This value may be null . |
public CharSequence getText ()
Get the text to be used for this message, or the fallback text if a type and content Uri have been set
Returns | |
---|---|
CharSequence |
public long getTimestamp ()
Get the time at which this message arrived
Returns | |
---|---|
long |
public Notification.MessagingStyle.Message setData (String dataMimeType, Uri dataUri)
Sets a binary blob of data and an associated MIME type for a message. In the case where the platform doesn't support the MIME type, the original text provided in the constructor will be used.
Parameters | |
---|---|
dataMimeType |
String : The MIME type of the content. See
for the list of supported MIME
types on Android and Android Wear. |
dataUri |
Uri : The uri containing the content whose type is given by the MIME type.
|
Returns | |
---|---|
Notification.MessagingStyle.Message |
this object for method chaining |