Language

AlertDialog.Builder.SetSingleChoiceItems Method

Definition

Overloads

Name Description
SetSingleChoiceItems(ICursor, Int32, String, EventHandler<DialogClickEventArgs>)

Configures a cursor-backed single-choice list with a managed click handler.

SetSingleChoiceItems(ICursor, Int32, String, IDialogInterfaceOnClickListener)

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.

SetSingleChoiceItems(String[], Int32, EventHandler<DialogClickEventArgs>)

Configures a string-based single-choice list with a managed click handler.

SetSingleChoiceItems(Int32, Int32, EventHandler<DialogClickEventArgs>)

Configures a resource-backed single-choice list with a managed click handler.

SetSingleChoiceItems(String[], Int32, IDialogInterfaceOnClickListener)

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.

SetSingleChoiceItems(ICharSequence[], Int32, EventHandler<DialogClickEventArgs>)

Configures a text-based single-choice list with a managed click handler.

SetSingleChoiceItems(ICharSequence[], Int32, IDialogInterfaceOnClickListener)

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.

SetSingleChoiceItems(IListAdapter, Int32, EventHandler<DialogClickEventArgs>)

Configures an adapter-backed single-choice list with a managed click handler.

SetSingleChoiceItems(IListAdapter, Int32, IDialogInterfaceOnClickListener)

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.

SetSingleChoiceItems(Int32, Int32, IDialogInterfaceOnClickListener)

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.

SetSingleChoiceItems(ICursor, Int32, String, EventHandler<DialogClickEventArgs>)

Configures a cursor-backed single-choice list with a managed click handler.

public Android.App.AlertDialog.Builder? SetSingleChoiceItems(Android.Database.ICursor cursor, int checkedItem, string labelColumn, EventHandler<Android.Content.DialogClickEventArgs> handler);
member this.SetSingleChoiceItems : Android.Database.ICursor * int * string * EventHandler<Android.Content.DialogClickEventArgs> -> Android.App.AlertDialog.Builder

Parameters

cursor
ICursor

The cursor that supplies the single-choice list entries.

checkedItem
Int32

The item index used for the initial selection.

labelColumn
String

The cursor column used for each entry's label.

handler
EventHandler<DialogClickEventArgs>

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

Returns

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

SetSingleChoiceItems(ICursor, Int32, String, IDialogInterfaceOnClickListener)

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.

[Android.Runtime.Register("setSingleChoiceItems", "(Landroid/database/Cursor;ILjava/lang/String;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetSingleChoiceItems_Landroid_database_Cursor_ILjava_lang_String_Landroid_content_DialogInterface_OnClickListener_Handler")]
public virtual Android.App.AlertDialog.Builder SetSingleChoiceItems(Android.Database.ICursor cursor, int checkedItem, string labelColumn, Android.Content.IDialogInterfaceOnClickListener listener);
[<Android.Runtime.Register("setSingleChoiceItems", "(Landroid/database/Cursor;ILjava/lang/String;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetSingleChoiceItems_Landroid_database_Cursor_ILjava_lang_String_Landroid_content_DialogInterface_OnClickListener_Handler")>]
abstract member SetSingleChoiceItems : Android.Database.ICursor * int * string * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder
override this.SetSingleChoiceItems : Android.Database.ICursor * int * string * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder

Parameters

cursor
ICursor

Cursor: the cursor to retrieve the items from.

checkedItem
Int32

int: specifies which item is checked. If -1 no items are checked.

labelColumn
String

String: The column name on the cursor containing the string to display in the label.

listener
IDialogInterfaceOnClickListener

DialogInterface.OnClickListener: notified when an item on the list is clicked. The dialog will not be dismissed when an item is clicked. It will only be dismissed if clicked on a button, if no buttons are supplied it's up to the user to dismiss the dialog.

Returns

This Builder object to allow for chaining of calls to set methods

Attributes

Remarks

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener. The list will have a check mark displayed to the right of the text for the checked item. Clicking on an item in the list will not dismiss the dialog. Clicking on a button will dismiss the dialog.

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

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

SetSingleChoiceItems(String[], Int32, EventHandler<DialogClickEventArgs>)

Configures a string-based single-choice list with a managed click handler.

public Android.App.AlertDialog.Builder? SetSingleChoiceItems(string[] items, int checkedItem, EventHandler<Android.Content.DialogClickEventArgs> handler);
member this.SetSingleChoiceItems : string[] * int * EventHandler<Android.Content.DialogClickEventArgs> -> Android.App.AlertDialog.Builder

Parameters

items
String[]

The strings available for single selection.

checkedItem
Int32

The item index used for the initial selection.

handler
EventHandler<DialogClickEventArgs>

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

Returns

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

SetSingleChoiceItems(Int32, Int32, EventHandler<DialogClickEventArgs>)

Configures a resource-backed single-choice list with a managed click handler.

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

Parameters

itemsId
Int32

The array resource containing the single-choice list entries.

checkedItem
Int32

The item index used for the initial selection.

handler
EventHandler<DialogClickEventArgs>

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

Returns

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

SetSingleChoiceItems(String[], Int32, IDialogInterfaceOnClickListener)

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.

public Android.App.AlertDialog.Builder SetSingleChoiceItems(string[]? items, int checkedItem, Android.Content.IDialogInterfaceOnClickListener listener);
member this.SetSingleChoiceItems : string[] * int * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder

Parameters

items
String[]

CharSequence: the items to be displayed.

checkedItem
Int32

int: specifies which item is checked. If -1 no items are checked.

listener
IDialogInterfaceOnClickListener

DialogInterface.OnClickListener: notified when an item on the list is clicked. The dialog will not be dismissed when an item is clicked. It will only be dismissed if clicked on a button, if no buttons are supplied it's up to the user to dismiss the dialog.

Returns

This Builder object to allow for chaining of calls to set methods

Remarks

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener. The list will have a check mark displayed to the right of the text for the checked item. Clicking on an item in the list will not dismiss the dialog. Clicking on a button will dismiss the dialog.

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

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

SetSingleChoiceItems(ICharSequence[], Int32, EventHandler<DialogClickEventArgs>)

Configures a text-based single-choice list with a managed click handler.

public Android.App.AlertDialog.Builder? SetSingleChoiceItems(Java.Lang.ICharSequence[] items, int checkedItem, EventHandler<Android.Content.DialogClickEventArgs> handler);
member this.SetSingleChoiceItems : Java.Lang.ICharSequence[] * int * EventHandler<Android.Content.DialogClickEventArgs> -> Android.App.AlertDialog.Builder

Parameters

items
ICharSequence[]

The text entries available for single selection.

checkedItem
Int32

The item index used for the initial selection.

handler
EventHandler<DialogClickEventArgs>

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

Returns

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

SetSingleChoiceItems(ICharSequence[], Int32, IDialogInterfaceOnClickListener)

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.

[Android.Runtime.Register("setSingleChoiceItems", "([Ljava/lang/CharSequence;ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetSingleChoiceItems_arrayLjava_lang_CharSequence_ILandroid_content_DialogInterface_OnClickListener_Handler")]
public virtual Android.App.AlertDialog.Builder SetSingleChoiceItems(Java.Lang.ICharSequence[]? items, int checkedItem, Android.Content.IDialogInterfaceOnClickListener listener);
[<Android.Runtime.Register("setSingleChoiceItems", "([Ljava/lang/CharSequence;ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetSingleChoiceItems_arrayLjava_lang_CharSequence_ILandroid_content_DialogInterface_OnClickListener_Handler")>]
abstract member SetSingleChoiceItems : Java.Lang.ICharSequence[] * int * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder
override this.SetSingleChoiceItems : Java.Lang.ICharSequence[] * int * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder

Parameters

items
ICharSequence[]

CharSequence: the items to be displayed.

checkedItem
Int32

int: specifies which item is checked. If -1 no items are checked.

listener
IDialogInterfaceOnClickListener

DialogInterface.OnClickListener: notified when an item on the list is clicked. The dialog will not be dismissed when an item is clicked. It will only be dismissed if clicked on a button, if no buttons are supplied it's up to the user to dismiss the dialog.

Returns

This Builder object to allow for chaining of calls to set methods

Attributes

Remarks

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener. The list will have a check mark displayed to the right of the text for the checked item. Clicking on an item in the list will not dismiss the dialog. Clicking on a button will dismiss the dialog.

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

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

SetSingleChoiceItems(IListAdapter, Int32, EventHandler<DialogClickEventArgs>)

Configures an adapter-backed single-choice list with a managed click handler.

public Android.App.AlertDialog.Builder? SetSingleChoiceItems(Android.Widget.IListAdapter adapter, int checkedItem, EventHandler<Android.Content.DialogClickEventArgs> handler);
member this.SetSingleChoiceItems : Android.Widget.IListAdapter * int * EventHandler<Android.Content.DialogClickEventArgs> -> Android.App.AlertDialog.Builder

Parameters

adapter
IListAdapter

The adapter that supplies the single-choice list entries.

checkedItem
Int32

The item index used for the initial selection.

handler
EventHandler<DialogClickEventArgs>

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

Returns

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

SetSingleChoiceItems(IListAdapter, Int32, IDialogInterfaceOnClickListener)

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.

[Android.Runtime.Register("setSingleChoiceItems", "(Landroid/widget/ListAdapter;ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetSingleChoiceItems_Landroid_widget_ListAdapter_ILandroid_content_DialogInterface_OnClickListener_Handler")]
public virtual Android.App.AlertDialog.Builder SetSingleChoiceItems(Android.Widget.IListAdapter adapter, int checkedItem, Android.Content.IDialogInterfaceOnClickListener listener);
[<Android.Runtime.Register("setSingleChoiceItems", "(Landroid/widget/ListAdapter;ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetSingleChoiceItems_Landroid_widget_ListAdapter_ILandroid_content_DialogInterface_OnClickListener_Handler")>]
abstract member SetSingleChoiceItems : Android.Widget.IListAdapter * int * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder
override this.SetSingleChoiceItems : Android.Widget.IListAdapter * int * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder

Parameters

adapter
IListAdapter

ListAdapter: The ListAdapter to supply the list of items

checkedItem
Int32

int: specifies which item is checked. If -1 no items are checked.

listener
IDialogInterfaceOnClickListener

DialogInterface.OnClickListener: notified when an item on the list is clicked. The dialog will not be dismissed when an item is clicked. It will only be dismissed if clicked on a button, if no buttons are supplied it's up to the user to dismiss the dialog.

Returns

This Builder object to allow for chaining of calls to set methods

Attributes

Remarks

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener. The list will have a check mark displayed to the right of the text for the checked item. Clicking on an item in the list will not dismiss the dialog. Clicking on a button will dismiss the dialog.

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

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

SetSingleChoiceItems(Int32, Int32, IDialogInterfaceOnClickListener)

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.

[Android.Runtime.Register("setSingleChoiceItems", "(IILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetSingleChoiceItems_IILandroid_content_DialogInterface_OnClickListener_Handler")]
public virtual Android.App.AlertDialog.Builder SetSingleChoiceItems(int itemsId, int checkedItem, Android.Content.IDialogInterfaceOnClickListener listener);
[<Android.Runtime.Register("setSingleChoiceItems", "(IILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetSingleChoiceItems_IILandroid_content_DialogInterface_OnClickListener_Handler")>]
abstract member SetSingleChoiceItems : int * int * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder
override this.SetSingleChoiceItems : int * int * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder

Parameters

itemsId
Int32

int: the resource id of an array i.e. R.array.foo

checkedItem
Int32

int: specifies which item is checked. If -1 no items are checked.

listener
IDialogInterfaceOnClickListener

DialogInterface.OnClickListener: notified when an item on the list is clicked. The dialog will not be dismissed when an item is clicked. It will only be dismissed if clicked on a button, if no buttons are supplied it's up to the user to dismiss the dialog.

Returns

This Builder object to allow for chaining of calls to set methods

Attributes

Remarks

Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener. This should be an array type i.e. R.array.foo The list will have a check mark displayed to the right of the text for the checked item. Clicking on an item in the list will not dismiss the dialog. Clicking on a button will dismiss the dialog.

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

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