AlertDialog.GetButton(Int32) Method

Definition

Gets one of the buttons used in the dialog.

[Android.Runtime.Register("getButton", "(I)Landroid/widget/Button;", "GetGetButton_IHandler")]
public virtual Android.Widget.Button? GetButton (int whichButton);
[<Android.Runtime.Register("getButton", "(I)Landroid/widget/Button;", "GetGetButton_IHandler")>]
abstract member GetButton : int -> Android.Widget.Button
override this.GetButton : int -> Android.Widget.Button

Parameters

whichButton
Int32

The identifier of the button that should be returned. For example, this can be DialogInterface#BUTTON_POSITIVE.

Returns

The button from the dialog, or null if a button does not exist.

Attributes

Remarks

Gets one of the buttons used in the dialog. Returns null if the specified button does not exist or the dialog has not yet been fully created (for example, via #show() or #create()).

Java documentation for android.app.AlertDialog.getButton(int).

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