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>)
SetNegativeButton(Int32, EventHandler<DialogClickEventArgs>)
SetNegativeButton(ICharSequence, EventHandler<DialogClickEventArgs>)
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>)

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

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

SetNegativeButton(Int32, EventHandler<DialogClickEventArgs>)

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

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

SetNegativeButton(ICharSequence, EventHandler<DialogClickEventArgs>)

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

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

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