Language

AlertDialog.Builder.SetNegativeButton Method

Definition

Overloads

Name Description
SetNegativeButton(String, IDialogInterfaceOnClickListener)

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

SetNegativeButton(String, EventHandler<DialogClickEventArgs>)

Configures the negative button from a string and managed click handler.

SetNegativeButton(Int32, EventHandler<DialogClickEventArgs>)

Configures the negative button from a text resource and managed click handler.

SetNegativeButton(ICharSequence, EventHandler<DialogClickEventArgs>)

Configures the negative button's text and managed click handler.

SetNegativeButton(ICharSequence, IDialogInterfaceOnClickListener)

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

SetNegativeButton(Int32, IDialogInterfaceOnClickListener)

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

SetNegativeButton(String, IDialogInterfaceOnClickListener)

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

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

Parameters

text
String

CharSequence: The text to display in the negative 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 negative button of the dialog is pressed.

Android reference for android.app.AlertDialog.Builder.setNegativeButton.

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

SetNegativeButton(String, EventHandler<DialogClickEventArgs>)

Configures the negative button from a string and managed click handler.

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

Parameters

text
String

The string shown on the dialog's negative button.

handler
EventHandler<DialogClickEventArgs>

The managed button-click handler to wrap as the dialog listener.

Returns

The result of the listener-based SetNegativeButton 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

SetNegativeButton(Int32, EventHandler<DialogClickEventArgs>)

Configures the negative button from a text resource and managed click handler.

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

Parameters

textId
Int32

The string resource used for the negative button's text.

handler
EventHandler<DialogClickEventArgs>

The managed button-click handler to wrap as the dialog listener.

Returns

The result of the listener-based SetNegativeButton 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

SetNegativeButton(ICharSequence, EventHandler<DialogClickEventArgs>)

Configures the negative button's text and managed click handler.

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

Parameters

text
ICharSequence

The text shown on the dialog's negative button.

handler
EventHandler<DialogClickEventArgs>

The managed button-click handler to wrap as the dialog listener.

Returns

The result of the listener-based SetNegativeButton 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

SetNegativeButton(ICharSequence, IDialogInterfaceOnClickListener)

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

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

Parameters

text
ICharSequence

CharSequence: The text to display in the negative 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 negative button of the dialog is pressed.

Android reference for android.app.AlertDialog.Builder.setNegativeButton.

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

SetNegativeButton(Int32, IDialogInterfaceOnClickListener)

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

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

Parameters

textId
Int32

int: The resource id of the text to display in the negative 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 negative button of the dialog is pressed.

Android reference for android.app.AlertDialog.Builder.setNegativeButton.

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