共用方式為


AlertDialog.Builder.SetPositiveButton Method

Definition

Overloads

SetPositiveButton(String, EventHandler<DialogClickEventArgs>)
SetPositiveButton(Int32, EventHandler<DialogClickEventArgs>)
SetPositiveButton(String, IDialogInterfaceOnClickListener)
SetPositiveButton(ICharSequence, EventHandler<DialogClickEventArgs>)
SetPositiveButton(ICharSequence, IDialogInterfaceOnClickListener)

Set a listener to be invoked when the positive button of the dialog is pressed.

SetPositiveButton(Int32, IDialogInterfaceOnClickListener)

Set a listener to be invoked when the positive button of the dialog is pressed.

SetPositiveButton(String, EventHandler<DialogClickEventArgs>)

public Android.App.AlertDialog.Builder? SetPositiveButton (string text, EventHandler<Android.Content.DialogClickEventArgs> handler);
member this.SetPositiveButton : string * EventHandler<Android.Content.DialogClickEventArgs> -> Android.App.AlertDialog.Builder

Parameters

text
String

Returns

Remarks

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

SetPositiveButton(Int32, EventHandler<DialogClickEventArgs>)

public Android.App.AlertDialog.Builder? SetPositiveButton (int textId, EventHandler<Android.Content.DialogClickEventArgs> handler);
member this.SetPositiveButton : int * EventHandler<Android.Content.DialogClickEventArgs> -> Android.App.AlertDialog.Builder

Parameters

textId
Int32

Returns

Remarks

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

SetPositiveButton(String, IDialogInterfaceOnClickListener)

public Android.App.AlertDialog.Builder SetPositiveButton (string text, Android.Content.IDialogInterfaceOnClickListener listener);
member this.SetPositiveButton : string * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder

Parameters

text
String

Returns

Remarks

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

SetPositiveButton(ICharSequence, EventHandler<DialogClickEventArgs>)

public Android.App.AlertDialog.Builder? SetPositiveButton (Java.Lang.ICharSequence text, EventHandler<Android.Content.DialogClickEventArgs> handler);
member this.SetPositiveButton : Java.Lang.ICharSequence * EventHandler<Android.Content.DialogClickEventArgs> -> Android.App.AlertDialog.Builder

Parameters

Returns

Remarks

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

SetPositiveButton(ICharSequence, IDialogInterfaceOnClickListener)

Set a listener to be invoked when the positive button of the dialog is pressed.

[Android.Runtime.Register("setPositiveButton", "(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetPositiveButton_Ljava_lang_CharSequence_Landroid_content_DialogInterface_OnClickListener_Handler")]
public virtual Android.App.AlertDialog.Builder SetPositiveButton (Java.Lang.ICharSequence text, Android.Content.IDialogInterfaceOnClickListener listener);
[<Android.Runtime.Register("setPositiveButton", "(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetPositiveButton_Ljava_lang_CharSequence_Landroid_content_DialogInterface_OnClickListener_Handler")>]
abstract member SetPositiveButton : Java.Lang.ICharSequence * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder
override this.SetPositiveButton : Java.Lang.ICharSequence * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder

Parameters

text
ICharSequence

The text to display in the positive button

Returns

Attributes

Remarks

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

SetPositiveButton(Int32, IDialogInterfaceOnClickListener)

Set a listener to be invoked when the positive button of the dialog is pressed.

[Android.Runtime.Register("setPositiveButton", "(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetPositiveButton_ILandroid_content_DialogInterface_OnClickListener_Handler")]
public virtual Android.App.AlertDialog.Builder SetPositiveButton (int textId, Android.Content.IDialogInterfaceOnClickListener listener);
[<Android.Runtime.Register("setPositiveButton", "(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetPositiveButton_ILandroid_content_DialogInterface_OnClickListener_Handler")>]
abstract member SetPositiveButton : int * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder
override this.SetPositiveButton : int * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder

Parameters

textId
Int32

The resource id of the text to display in the positive button

Returns

Attributes

Remarks

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