Język

AlertDialog.Builder Constructors

Definition

Overloads

Name Description
AlertDialog.Builder(Context)

Creates a builder for an alert dialog that uses the default alert dialog theme.

AlertDialog.Builder(Context, Int32)

Creates a builder for an alert dialog that uses an explicit theme resource.

AlertDialog.Builder(IntPtr, JniHandleOwnership)

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

AlertDialog.Builder(Context)

Creates a builder for an alert dialog that uses the default alert dialog theme.

[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.AlertDialog.Builder : Android.Content.Context -> Android.App.AlertDialog.Builder

Parameters

context
Context

the parent context

Attributes

Remarks

Creates a builder for an alert dialog that uses the default alert dialog theme. The default alert dialog theme is defined by R.attr.alertDialogTheme within the parent context's theme.

Android reference for android.app.AlertDialog.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

AlertDialog.Builder(Context, Int32)

Creates a builder for an alert dialog that uses an explicit theme resource.

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;I)V", "")]
public Builder(Android.Content.Context context, int themeResId);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;I)V", "")>]
new Android.App.AlertDialog.Builder : Android.Content.Context * int -> Android.App.AlertDialog.Builder

Parameters

context
Context

the parent context

themeResId
Int32

the resource ID of the theme against which to inflate this dialog, or 0 to use the parent context's default alert dialog theme

Attributes

Remarks

Creates a builder for an alert dialog that uses an explicit theme resource. The specified theme resource (themeResId) is applied on top of the parent context's theme. It may be specified as a style resource containing a fully-populated theme, such as R.style.Theme_Material_Dialog, to replace all attributes in the parent context's theme including primary and accent colors. To preserve attributes such as primary and accent colors, the themeResId may instead be specified as an overlay theme such as R.style.ThemeOverlay_Material_Dialog. This will override only the window attributes necessary to style the alert window as a dialog. Alternatively, the themeResId may be specified as 0 to use the parent context's resolved value for R.attr.alertDialogTheme.

Android reference for android.app.AlertDialog.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

AlertDialog.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.AlertDialog.Builder : nativeint * Android.Runtime.JniHandleOwnership -> Android.App.AlertDialog.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