NotificationChannel Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| NotificationChannel(String, ICharSequence, NotificationImportance) |
Creates a notification channel. |
| NotificationChannel(String, String, NotificationImportance) |
Creates a notification channel. |
NotificationChannel(String, ICharSequence, NotificationImportance)
Creates a notification channel.
[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
Parameters
- id
- String
String: The id of the channel. Must be unique per package. The value may be truncated if it is too long.
- name
- ICharSequence
CharSequence: The user visible name of the channel. You can rename this channel when the system locale changes by listening for the Intent.ACTION_LOCALE_CHANGED broadcast. The recommended maximum length is 40 characters; the value may be truncated if it is too long.
- importance
- NotificationImportance
int: The importance of the channel. This controls how interruptive notifications posted to this channel are. Value is one of the following: NotificationManager.IMPORTANCE_UNSPECIFIED NotificationManager.IMPORTANCE_NONE NotificationManager.IMPORTANCE_MIN NotificationManager.IMPORTANCE_LOW NotificationManager.IMPORTANCE_DEFAULT NotificationManager.IMPORTANCE_HIGH
- Attributes
Remarks
Creates a notification channel.
Android reference for android.app.NotificationChannel.NotificationChannel.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
NotificationChannel(String, String, NotificationImportance)
Creates a notification channel.
[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
Parameters
- id
- String
String: The id of the channel. Must be unique per package. The value may be truncated if it is too long.
- name
- String
CharSequence: The user visible name of the channel. You can rename this channel when the system locale changes by listening for the Intent.ACTION_LOCALE_CHANGED broadcast. The recommended maximum length is 40 characters; the value may be truncated if it is too long.
- importance
- NotificationImportance
int: The importance of the channel. This controls how interruptive notifications posted to this channel are. Value is one of the following: NotificationManager.IMPORTANCE_UNSPECIFIED NotificationManager.IMPORTANCE_NONE NotificationManager.IMPORTANCE_MIN NotificationManager.IMPORTANCE_LOW NotificationManager.IMPORTANCE_DEFAULT NotificationManager.IMPORTANCE_HIGH
- Attributes
Remarks
Creates a notification channel.
Android reference for android.app.NotificationChannel.NotificationChannel.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.