public static final class Notification.MessagingStyle.Message
extends Object
| java.lang.Object | |
| android.app.Notification.MessagingStyle.Message | |
Public constructors |
|
|---|---|
Notification.MessagingStyle.Message(CharSequence text, long timestamp, CharSequence sender) 构造函数 |
|
公共方法(Public methods) |
|
|---|---|
String |
getDataMimeType() 获取Uri指向的数据的MIME类型 |
Uri |
getDataUri() 获取Uri指向消息的内容。 |
CharSequence |
getSender() 获取用于在消息传递体验中显示联系人姓名的文本 |
CharSequence |
getText() 获取用于此消息的文本,或者在设置了类型和内容Uri的情况下获取后备文本 |
long |
getTimestamp() 获取此消息到达的时间 |
Notification.MessagingStyle.Message |
setData(String dataMimeType, Uri dataUri) 为消息设置二进制blob数据和关联的MIME类型。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
Notification.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. |
String getDataMimeType ()
获取Uri指向的数据的MIME类型
| 返回(Returns) | |
|---|---|
String |
|
Uri getDataUri ()
获取Uri指向消息的内容。 可以为null,在这种情况下使用。
| 返回(Returns) | |
|---|---|
Uri |
|
也可以看看:
CharSequence getSender ()
获取用于在消息传递体验中显示联系人姓名的文本
| 返回(Returns) | |
|---|---|
CharSequence |
|
CharSequence getText ()
获取用于此消息的文本,或者在设置了类型和内容Uri的情况下获取后备文本
| 返回(Returns) | |
|---|---|
CharSequence |
|
Notification.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) | |
|---|---|
Notification.MessagingStyle.Message |
this object for method chaining |