AlertDialog.Builder.SetPositiveButton Method
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 |
|---|---|
| SetPositiveButton(String, EventHandler<DialogClickEventArgs>) |
Configures the positive button from a string and managed click handler. |
| SetPositiveButton(Int32, EventHandler<DialogClickEventArgs>) |
Configures the positive button from a text resource and managed click handler. |
| SetPositiveButton(String, IDialogInterfaceOnClickListener) |
Set a listener to be invoked when the positive button of the dialog is pressed. |
| SetPositiveButton(ICharSequence, EventHandler<DialogClickEventArgs>) |
Configures the positive button's text and managed click handler. |
| 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>)
Configures the positive button from a string and managed click handler.
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
The string shown on the dialog's positive button.
- handler
- EventHandler<DialogClickEventArgs>
The managed button-click handler to wrap as the dialog listener.
Returns
The result of the listener-based SetPositiveButton overload.
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>)
Configures the positive button from a text resource and managed click handler.
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
The string resource used for the positive button's text.
- handler
- EventHandler<DialogClickEventArgs>
The managed button-click handler to wrap as the dialog listener.
Returns
The result of the listener-based SetPositiveButton overload.
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)
Set a listener to be invoked when the positive button of the dialog is pressed.
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
CharSequence: The text to display in the positive button
- listener
- IDialogInterfaceOnClickListener
DialogInterface.OnClickListener: The DialogInterface.OnClickListener to use.
Returns
This Builder object to allow for chaining of calls to set methods
Remarks
Set a listener to be invoked when the positive button of the dialog is pressed.
Android reference for android.app.AlertDialog.Builder.setPositiveButton.
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>)
Configures the positive button's text and managed click handler.
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
- text
- ICharSequence
The text shown on the dialog's positive button.
- handler
- EventHandler<DialogClickEventArgs>
The managed button-click handler to wrap as the dialog listener.
Returns
The result of the listener-based SetPositiveButton overload.
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
CharSequence: The text to display in the positive button
- listener
- IDialogInterfaceOnClickListener
DialogInterface.OnClickListener: The DialogInterface.OnClickListener to use.
Returns
This Builder object to allow for chaining of calls to set methods
- Attributes
Remarks
Set a listener to be invoked when the positive button of the dialog is pressed.
Android reference for android.app.AlertDialog.Builder.setPositiveButton.
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
int: The resource id of the text to display in the positive button
- listener
- IDialogInterfaceOnClickListener
DialogInterface.OnClickListener: The DialogInterface.OnClickListener to use.
Returns
This Builder object to allow for chaining of calls to set methods
- Attributes
Remarks
Set a listener to be invoked when the positive button of the dialog is pressed.
Android reference for android.app.AlertDialog.Builder.setPositiveButton.
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.