Message
class Message
kotlin.Any | |
↳ | androidx.core.app.NotificationCompat.MessagingStyle.Message |
Summary
Public constructors | |
---|---|
<init>(@Nullable text: CharSequence?, timestamp: Long, @Nullable person: Person?) Creates a new |
|
<init>(@Nullable text: CharSequence?, timestamp: Long, @Nullable sender: CharSequence?) Constructor |
Public methods | |
---|---|
String? |
Get the MIME type of the data pointed to by the URI. |
Uri? |
Get the the Uri pointing to the content of the message. |
Bundle |
Get the extras Bundle for this message. |
Person? |
Returns the |
CharSequence? |
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 |
Get the time at which this message arrived in ms since Unix epoch. |
NotificationCompat.MessagingStyle.Message |
Sets a binary blob of data and an associated MIME type for a message. |
Public constructors
<init>
Message(
@Nullable text: CharSequence?,
timestamp: Long,
@Nullable person: Person?)
Creates a new Message
with the given text, timestamp, and sender.
Parameters | |
---|---|
text |
CharSequence?: A CharSequence to be displayed as the message content |
timestamp |
Long: Time at which the message arrived in ms since Unix epoch |
person |
Person?: A Person whose Person#getName() value is used as the display name for the sender. This should be null for messages by the current user, in which case, the platform will insert MessagingStyle#getUserDisplayName() . A Person 's key should be consistent during re-posts of the notification. |
<init>
Message(
@Nullable text: CharSequence?,
timestamp: Long,
@Nullable sender: CharSequence?)
Deprecated: Use the alternative constructor instead.
Constructor
Parameters | |
---|---|
text |
CharSequence?: A CharSequence to be displayed as the message content |
timestamp |
Long: Time at which the message arrived in ms since Unix epoch |
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 methods
getDataMimeType
@Nullable fun getDataMimeType(): String?
Get the MIME type of the data pointed to by the URI.
getDataUri
@Nullable fun getDataUri(): Uri?
Get the the Uri pointing to the content of the message. Can be null, in which case {@see #getText()} is used.
getSender
@Nullable fungetSender(): CharSequence?
Deprecated: Use getPerson()
Get the text used to display the contact's name in the messaging experience
getText
@Nullable fun getText(): CharSequence?
Get the text to be used for this message, or the fallback text if a type and content Uri have been set
getTimestamp
fun getTimestamp(): Long
Get the time at which this message arrived in ms since Unix epoch.
setData
@NonNull fun setData(
@Nullable