NotificationChannel 建構函式

定義

多載

NotificationChannel(String, ICharSequence, NotificationImportance)

建立通知通道。

NotificationChannel(String, String, NotificationImportance)

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.app.NotificationChannel.NotificationChannel(java.lang.String, java.lang.CharSequence, int)Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於

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
name
String
屬性

備註

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於