Share via


AlertDialog.SetButton2 Method

Definition

Overloads

SetButton2(String, EventHandler<DialogClickEventArgs>)
SetButton2(String, Message)
Obsolete.

This member is deprecated.

SetButton2(String, IDialogInterfaceOnClickListener)
Obsolete.

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

SetButton2(ICharSequence, Message)
Obsolete.

This member is deprecated.

SetButton2(ICharSequence, IDialogInterfaceOnClickListener)
Obsolete.

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

SetButton2(ICharSequence, EventHandler<DialogClickEventArgs>)

SetButton2(String, EventHandler<DialogClickEventArgs>)

public void SetButton2 (string text, EventHandler<Android.Content.DialogClickEventArgs> handler);

Parameters

text
String

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

.NET for Android .NET for Android API 35 and .NET for Android .NET for Android API 34
Product Versions
.NET for Android .NET for Android API 34, .NET for Android API 35

SetButton2(String, Message)

Caution

deprecated

This member is deprecated.

[System.Obsolete("deprecated")]
public void SetButton2 (string? text, Android.OS.Message? msg);

Parameters

text
String

The text to display in button 2.

msg
Message
Attributes

Remarks

This member is deprecated. Use #setButton(int, CharSequence, Message) with DialogInterface#BUTTON_NEGATIVE.

Java documentation for android.app.AlertDialog.setButton2(java.lang.CharSequence, android.os.Message).

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

.NET for Android .NET for Android API 35 and .NET for Android .NET for Android API 34
Product Versions (Obsolete)
.NET for Android (.NET for Android API 34, .NET for Android API 35)

SetButton2(String, IDialogInterfaceOnClickListener)

Caution

deprecated

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

[System.Obsolete("deprecated")]
public void SetButton2 (string? text, Android.Content.IDialogInterfaceOnClickListener? listener);

Parameters

text
String

The text to display in button 2.

listener
IDialogInterfaceOnClickListener

The DialogInterface.OnClickListener to use.

Attributes

Remarks

Java documentation for android.app.AlertDialog.setButton2(java.lang.CharSequence, android.content.OnClickListener).

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

.NET for Android .NET for Android API 35 and .NET for Android .NET for Android API 34
Product Versions (Obsolete)
.NET for Android (.NET for Android API 34, .NET for Android API 35)

SetButton2(ICharSequence, Message)

Caution

deprecated

This member is deprecated.

[Android.Runtime.Register("setButton2", "(Ljava/lang/CharSequence;Landroid/os/Message;)V", "GetSetButton2_Ljava_lang_CharSequence_Landroid_os_Message_Handler")]
[System.Obsolete("deprecated")]
public virtual void SetButton2 (Java.Lang.ICharSequence? text, Android.OS.Message? msg);

Parameters

text
ICharSequence

The text to display in button 2.

msg
Message
Attributes

Remarks

This member is deprecated. Use #setButton(int, CharSequence, Message) with DialogInterface#BUTTON_NEGATIVE.

Java documentation for android.app.AlertDialog.setButton2(java.lang.CharSequence, android.os.Message).

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

.NET for Android .NET for Android API 35 and .NET for Android .NET for Android API 34
Product Versions (Obsolete)
.NET for Android (.NET for Android API 34, .NET for Android API 35)

SetButton2(ICharSequence, IDialogInterfaceOnClickListener)

Caution

deprecated

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

[Android.Runtime.Register("setButton2", "(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)V", "GetSetButton2_Ljava_lang_CharSequence_Landroid_content_DialogInterface_OnClickListener_Handler")]
[System.Obsolete("deprecated")]
public virtual void SetButton2 (Java.Lang.ICharSequence? text, Android.Content.IDialogInterfaceOnClickListener? listener);

Parameters

text
ICharSequence

The text to display in button 2.

listener
IDialogInterfaceOnClickListener

The DialogInterface.OnClickListener to use.

Attributes

Remarks

Java documentation for android.app.AlertDialog.setButton2(java.lang.CharSequence, android.content.OnClickListener).

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

.NET for Android .NET for Android API 35 and .NET for Android .NET for Android API 34
Product Versions (Obsolete)
.NET for Android (.NET for Android API 34, .NET for Android API 35)

SetButton2(ICharSequence, EventHandler<DialogClickEventArgs>)

public void SetButton2 (Java.Lang.ICharSequence text, EventHandler<Android.Content.DialogClickEventArgs> handler);

Parameters

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

.NET for Android .NET for Android API 35 and .NET for Android .NET for Android API 34
Product Versions
.NET for Android .NET for Android API 34, .NET for Android API 35