Notification.Builder Constructors

Definition

Overloads

Name Description
Notification.Builder(Context)

This constructor is deprecated.

Notification.Builder(Context, String)

Constructs a new Builder with the defaults:

Notification.Builder(IntPtr, JniHandleOwnership)

Initializes a managed representation of an existing Java Native Interface object.

Notification.Builder(Context)

This constructor is deprecated.

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;)V", "")]
public Builder(Android.Content.Context? context);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;)V", "")>]
new Android.App.Notification.Builder : Android.Content.Context -> Android.App.Notification.Builder

Parameters

context
Context

Context

Attributes

Remarks

This constructor is deprecated. use Builder(Context,String) instead. All posted Notifications must specify a NotificationChannel Id.

Android reference for android.app.Notification.Builder.Builder.

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

Notification.Builder(Context, String)

Constructs a new Builder with the defaults:

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Ljava/lang/String;)V", "", ApiSince=26)]
public Builder(Android.Content.Context? context, string? channelId);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Ljava/lang/String;)V", "", ApiSince=26)>]
new Android.App.Notification.Builder : Android.Content.Context * string -> Android.App.Notification.Builder

Parameters

context
Context

Context: A Context that will be used by the Builder to construct the RemoteViews. The Context will not be held past the lifetime of this Builder object.

channelId
String

String: The constructed Notification will be posted on this NotificationChannel. To use a NotificationChannel, it must first be created using NotificationManager.createNotificationChannel.

Attributes

Remarks

Constructs a new Builder with the defaults:

Android reference for android.app.Notification.Builder.Builder.

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

Notification.Builder(IntPtr, JniHandleOwnership)

Initializes a managed representation of an existing Java Native Interface object.

protected Builder(IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.App.Notification.Builder : nativeint * Android.Runtime.JniHandleOwnership -> Android.App.Notification.Builder

Parameters

javaReference
IntPtr

nativeint

The Java Native Interface object reference.

transfer
JniHandleOwnership

The ownership transfer to apply to the Java Native Interface object reference.

Remarks

This constructor is called by the .NET for Android binding runtime when it creates a managed peer for an existing Java object.

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