語言

NotificationChannel 建構函式

定義

多載

NotificationChannel(String, ICharSequence, NotificationImportance)

建立通知頻道。

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/lang/CharSequence;I)V", "", ApiSince=26)]
public NotificationChannel(string? id, Java.Lang.ICharSequence? name, Android.App.NotificationImportance importance);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/lang/CharSequence;I)V", "", ApiSince=26)>]
new Android.App.NotificationChannel : string * Java.Lang.ICharSequence * Android.App.NotificationImportance -> Android.App.NotificationChannel

參數

id
String

通道的識別碼。 每個包裹必須是獨一無二的。 若值過長,可能會被截斷。

name
ICharSequence

頻道的使用者可見名稱。 當系統地點變更時,您可以透過收聽 Intent#ACTION_LOCALE_CHANGED 廣播來重新命名此頻道。 建議最大長度為40字元;若值過長,可能會被截斷。

importance
NotificationImportance

頻道的重要性。 這會控制本頻道發布的通知是否會被打斷。

屬性

備註

建立通知頻道。

Android 參考資料。android.app.NotificationChannel.NotificationChannel

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

適用於

NotificationChannel(String, String, NotificationImportance)

建立通知頻道。

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/lang/CharSequence;I)V", "", ApiSince=26)]
public NotificationChannel(string? id, string? name, Android.App.NotificationImportance importance);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/lang/CharSequence;I)V", "", ApiSince=26)>]
new Android.App.NotificationChannel : string * string * Android.App.NotificationImportance -> Android.App.NotificationChannel

參數

id
String

String:頻道的ID。 每個包裹必須是獨一無二的。 若值過長,可能會被截斷。

name
String

CharSequence:頻道的使用者可見名稱。 當系統地點變更時,您可以透過收聽Intent.ACTION_LOCALE_CHANGED廣播來重新命名此頻道。 建議最大長度為40字元;若值過長,可能會被截斷。

importance
NotificationImportance

int:頻道的重要性。 這會控制本頻道發布的通知是否會被打斷。 價值屬於以下之一:NotificationManager.IMPORTANCE_UNSPECIFIED NotificationManager.IMPORTANCE_NONE NotificationManager.IMPORTANCE_MIN NotificationManager.IMPORTANCE_LOW NotificationManager.IMPORTANCE_DEFAULT NotificationManager.IMPORTANCE_HIGH

屬性

備註

建立通知頻道。

Android 參考資料。android.app.NotificationChannel.NotificationChannel

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

適用於