語言

Notification.MessagingStyle.AddMessage 方法

定義

多載

名稱 Description
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

參數

message
Notification.MessagingStyle.Message

Notification.MessageagingStyle.Message:要顯示的訊息

傳回

此物件用於方法鏈結

屬性

備註

新增訊息以顯示於此通知中。 訊息應依時間順序添加,即最舊的先,最新的最後。 多個連續且具有相同時間戳記與發送者的訊息,可以被歸為一則訊息。 這表示應用程式應該將同時包含圖片與文字的訊息以兩個訊息物件表示,一個包含圖片(及備援文字),另一個包含訊息文字。 為了保持一致性,Uri 內容後應提供簡訊(如有)。

Android 參考資料。android.app.Notification.MessagingStyle.addMessage

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

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。 這個值不可能為零值。

timestamp
Int64

長:訊息到達的時間(毫秒)

sender
Person

人物:發送訊息的人。 目前使用者的訊息應該會是空,此時平台會在 MessagingStyle(Person) 中插入使用者集。

傳回

此物件用於方法鏈結

屬性

備註

新增訊息以供此通知顯示。 方便呼叫,只需在 addMessage(Notification.MessagingStyle.Message) 中輸入簡單的訊息。

另請參閱:

Android 參考資料。android.app.Notification.MessagingStyle.addMessage

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

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

長:訊息到達的時間(毫秒)

sender
ICharSequence

CharSequence:用於顯示寄件者姓名的 CharSequence。 目前使用者的訊息應該會為 null,此時平台會插入 getUserDisplayName()。 在對話中所有成員中,應該是獨一無二的,且在重新發布通知時應保持一致。

傳回

此物件用於方法鏈結

屬性

備註

此方法在 API 等級 28 中被棄用。 使用 addMessage(CharSequence, long, Person)

新增訊息以供此通知顯示。 方便呼叫,只需在 addMessage(Notification.MessagingStyle.Message) 中輸入簡單的訊息。

另請參閱:

Android 參考資料。android.app.Notification.MessagingStyle.addMessage

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

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。 這個值不可能為零值。

timestamp
Int64

長:訊息到達的時間(毫秒)

sender
Person

人物:發送訊息的人。 目前使用者的訊息應該會是空,此時平台會在 MessagingStyle(Person) 中插入使用者集。

傳回

此物件用於方法鏈結

備註

新增訊息以供此通知顯示。 方便呼叫,只需在 addMessage(Notification.MessagingStyle.Message) 中輸入簡單的訊息。

另請參閱:

Android 參考資料。android.app.Notification.MessagingStyle.addMessage

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

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

長:訊息到達的時間(毫秒)

sender
String

CharSequence:用於顯示寄件者姓名的 CharSequence。 目前使用者的訊息應該會為 null,此時平台會插入 getUserDisplayName()。 在對話中所有成員中,應該是獨一無二的,且在重新發布通知時應保持一致。

傳回

此物件用於方法鏈結

備註

此方法在 API 等級 28 中被棄用。 使用 addMessage(CharSequence, long, Person)

新增訊息以供此通知顯示。 方便呼叫,只需在 addMessage(Notification.MessagingStyle.Message) 中輸入簡單的訊息。

另請參閱:

Android 參考資料。android.app.Notification.MessagingStyle.addMessage

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於