public static final class NotificationCompat.MessagingStyle.Message
extends Object
java.lang.Object | |
↳ | android.support.v4.app.NotificationCompat.MessagingStyle.Message |
Public constructors |
|
---|---|
NotificationCompat.MessagingStyle.Message(CharSequence text, long timestamp, CharSequence sender) 构造函数 |
Public methods |
|
---|---|
String |
getDataMimeType() 获取Uri指向的数据的MIME类型 |
Uri |
getDataUri() 获取Uri指向消息的内容。 |
CharSequence |
getSender() 获取用于在消息传递体验中显示联系人姓名的文本 |
CharSequence |
getText() 获取用于此消息的文本,或者在设置了类型和内容Uri的情况下获取后备文本 |
long |
getTimestamp() 获取此消息到达的时间 |
NotificationCompat.MessagingStyle.Message |
setData(String dataMimeType, Uri dataUri) 为消息设置二进制blob数据和关联的MIME类型。 |
Inherited methods |
|
---|---|
From class java.lang.Object
|
NotificationCompat.MessagingStyle.Message (CharSequence text, long timestamp, CharSequence sender)
构造函数
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 getUserDisplayName() . Should be unique amongst all individuals in the conversation, and should be consistent during re-posts of the notification. |
long getTimestamp ()
获取此消息到达的时间
Returns | |
---|---|
long |
NotificationCompat.MessagingStyle.Message setData (String dataMimeType, Uri dataUri)
为消息设置二进制blob数据和关联的MIME类型。 在平台不支持MIME类型的情况下,将使用构造函数中提供的原始文本。
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 | |
---|---|
NotificationCompat.MessagingStyle.Message |
this object for method chaining |