Notification.MessagingStyle.AddMessage 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| AddMessage(Notification+MessagingStyle+Message) |
添加用于在此通知中显示的消息。 |
| AddMessage(ICharSequence, Int64, Person) |
添加此通知显示的消息。 |
| AddMessage(ICharSequence, Int64, ICharSequence) |
此方法在 API 级别 28 中已弃用。 |
| AddMessage(String, Int64, Person) |
添加此通知显示的消息。 |
| AddMessage(String, Int64, String) |
此方法在 API 级别 28 中已弃用。 |
AddMessage(Notification+MessagingStyle+Message)
添加用于在此通知中显示的消息。
[Android.Runtime.Register("addMessage", "(Landroid/app/Notification$MessagingStyle$Message;)Landroid/app/Notification$MessagingStyle;", "GetAddMessage_Landroid_app_Notification_MessagingStyle_Message_Handler", ApiSince=24)]
public virtual Android.App.Notification.MessagingStyle? AddMessage(Android.App.Notification.MessagingStyle.Message? message);
[<Android.Runtime.Register("addMessage", "(Landroid/app/Notification$MessagingStyle$Message;)Landroid/app/Notification$MessagingStyle;", "GetAddMessage_Landroid_app_Notification_MessagingStyle_Message_Handler", ApiSince=24)>]
abstract member AddMessage : Android.App.Notification.MessagingStyle.Message -> Android.App.Notification.MessagingStyle
override this.AddMessage : Android.App.Notification.MessagingStyle.Message -> Android.App.Notification.MessagingStyle
参数
Notification.MessagingStyle.Message:要显示的消息
返回
此方法链接的此对象
- 特性
注解
添加用于在此通知中显示的消息。 消息应按时间顺序添加,即最旧的第一个消息,即最新消息。 行中具有相同时间戳和发件人的多个消息可以分组为单个消息。 这意味着应用应将图像和文本都表示为两个 Message 对象的消息,一个对象包含图像(以及回退文本),另一个包含消息文本。 为了保持一致性,应在 URI 内容后提供短信(如果有)。
Android 参考。android.app.Notification.MessagingStyle.addMessage
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
AddMessage(ICharSequence, Int64, Person)
添加此通知显示的消息。
[Android.Runtime.Register("addMessage", "(Ljava/lang/CharSequence;JLandroid/app/Person;)Landroid/app/Notification$MessagingStyle;", "GetAddMessage_Ljava_lang_CharSequence_JLandroid_app_Person_Handler", ApiSince=28)]
public virtual Android.App.Notification.MessagingStyle? AddMessage(Java.Lang.ICharSequence text, long timestamp, Android.App.Person? sender);
[<Android.Runtime.Register("addMessage", "(Ljava/lang/CharSequence;JLandroid/app/Person;)Landroid/app/Notification$MessagingStyle;", "GetAddMessage_Ljava_lang_CharSequence_JLandroid_app_Person_Handler", ApiSince=28)>]
abstract member AddMessage : Java.Lang.ICharSequence * int64 * Android.App.Person -> Android.App.Notification.MessagingStyle
override this.AddMessage : Java.Lang.ICharSequence * int64 * Android.App.Person -> Android.App.Notification.MessagingStyle
参数
- text
- ICharSequence
CharSequence:要显示为消息内容的 CharSequence。 此值不能为 null。
- timestamp
- Int64
long:消息到达的时间(以毫秒为单位)
- sender
- Person
人员:发送邮件的人员。 对于当前用户的消息应为 null,在这种情况下,平台将在 MessagingStyle(Person)中插入用户集。
返回
此方法链接的此对象
- 特性
注解
添加此通知显示的消息。 addMessage(Notification.MessagingStyle.Message)中简单消息的便利调用。
Android 参考。android.app.Notification.MessagingStyle.addMessage
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
AddMessage(ICharSequence, Int64, ICharSequence)
此方法在 API 级别 28 中已弃用。
[Android.Runtime.Register("addMessage", "(Ljava/lang/CharSequence;JLjava/lang/CharSequence;)Landroid/app/Notification$MessagingStyle;", "GetAddMessage_Ljava_lang_CharSequence_JLjava_lang_CharSequence_Handler", ApiSince=24)]
public virtual Android.App.Notification.MessagingStyle? AddMessage(Java.Lang.ICharSequence? text, long timestamp, Java.Lang.ICharSequence? sender);
[<Android.Runtime.Register("addMessage", "(Ljava/lang/CharSequence;JLjava/lang/CharSequence;)Landroid/app/Notification$MessagingStyle;", "GetAddMessage_Ljava_lang_CharSequence_JLjava_lang_CharSequence_Handler", ApiSince=24)>]
abstract member AddMessage : Java.Lang.ICharSequence * int64 * Java.Lang.ICharSequence -> Android.App.Notification.MessagingStyle
override this.AddMessage : Java.Lang.ICharSequence * int64 * Java.Lang.ICharSequence -> Android.App.Notification.MessagingStyle
参数
- text
- ICharSequence
CharSequence:要显示为消息内容的 CharSequence
- timestamp
- Int64
long:消息到达的时间(以毫秒为单位)
- sender
- ICharSequence
CharSequence:用于显示发件人名称的 CharSequence。 对于当前用户的消息应为 null,在这种情况下,平台将插入 getUserDisplayName()。 在对话中的所有个人中应是唯一的,应在通知的重新发布期间保持一致。
返回
此方法链接的此对象
- 特性
注解
此方法在 API 级别 28 中已弃用。 use addMessage(CharSequence,long,Person)
添加此通知显示的消息。 addMessage(Notification.MessagingStyle.Message)中简单消息的便利调用。
Android 参考。android.app.Notification.MessagingStyle.addMessage
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
AddMessage(String, Int64, Person)
添加此通知显示的消息。
public Android.App.Notification.MessagingStyle? AddMessage(string text, long timestamp, Android.App.Person? sender);
member this.AddMessage : string * int64 * Android.App.Person -> Android.App.Notification.MessagingStyle
参数
- text
- String
CharSequence:要显示为消息内容的 CharSequence。 此值不能为 null。
- timestamp
- Int64
long:消息到达的时间(以毫秒为单位)
- sender
- Person
人员:发送邮件的人员。 对于当前用户的消息应为 null,在这种情况下,平台将在 MessagingStyle(Person)中插入用户集。
返回
此方法链接的此对象
注解
添加此通知显示的消息。 addMessage(Notification.MessagingStyle.Message)中简单消息的便利调用。
Android 参考。android.app.Notification.MessagingStyle.addMessage
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
AddMessage(String, Int64, String)
此方法在 API 级别 28 中已弃用。
public Android.App.Notification.MessagingStyle? AddMessage(string? text, long timestamp, string? sender);
member this.AddMessage : string * int64 * string -> Android.App.Notification.MessagingStyle
参数
- text
- String
CharSequence:要显示为消息内容的 CharSequence
- timestamp
- Int64
long:消息到达的时间(以毫秒为单位)
- sender
- String
CharSequence:用于显示发件人名称的 CharSequence。 对于当前用户的消息应为 null,在这种情况下,平台将插入 getUserDisplayName()。 在对话中的所有个人中应是唯一的,应在通知的重新发布期间保持一致。
返回
此方法链接的此对象
注解
此方法在 API 级别 28 中已弃用。 use addMessage(CharSequence,long,Person)
添加此通知显示的消息。 addMessage(Notification.MessagingStyle.Message)中简单消息的便利调用。
Android 参考。android.app.Notification.MessagingStyle.addMessage
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。