AlertDialog.Builder.SetAdapter Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| SetAdapter(IListAdapter, EventHandler<DialogClickEventArgs>) |
Configures an adapter-backed dialog list with a managed click handler. |
| SetAdapter(IListAdapter, IDialogInterfaceOnClickListener) |
Set a list of items, which are supplied by the given ListAdapter, to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener. |
SetAdapter(IListAdapter, EventHandler<DialogClickEventArgs>)
Configures an adapter-backed dialog list with a managed click handler.
public Android.App.AlertDialog.Builder? SetAdapter(Android.Widget.IListAdapter adapter, EventHandler<Android.Content.DialogClickEventArgs> handler);
member this.SetAdapter : Android.Widget.IListAdapter * EventHandler<Android.Content.DialogClickEventArgs> -> Android.App.AlertDialog.Builder
Parameters
- adapter
- IListAdapter
The adapter that supplies the dialog's list entries.
- handler
- EventHandler<DialogClickEventArgs>
The managed item-click handler to wrap as the dialog listener.
Returns
The result of the listener-based SetAdapter 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
SetAdapter(IListAdapter, IDialogInterfaceOnClickListener)
Set a list of items, which are supplied by the given ListAdapter, to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.
[Android.Runtime.Register("setAdapter", "(Landroid/widget/ListAdapter;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetAdapter_Landroid_widget_ListAdapter_Landroid_content_DialogInterface_OnClickListener_Handler")]
public virtual Android.App.AlertDialog.Builder SetAdapter(Android.Widget.IListAdapter adapter, Android.Content.IDialogInterfaceOnClickListener listener);
[<Android.Runtime.Register("setAdapter", "(Landroid/widget/ListAdapter;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;", "GetSetAdapter_Landroid_widget_ListAdapter_Landroid_content_DialogInterface_OnClickListener_Handler")>]
abstract member SetAdapter : Android.Widget.IListAdapter * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder
override this.SetAdapter : Android.Widget.IListAdapter * Android.Content.IDialogInterfaceOnClickListener -> Android.App.AlertDialog.Builder
Parameters
- adapter
- IListAdapter
ListAdapter: The ListAdapter to supply the list of items
- listener
- IDialogInterfaceOnClickListener
DialogInterface.OnClickListener: The listener that will be called when an item is clicked.
Returns
This Builder object to allow for chaining of calls to set methods
- Attributes
Remarks
Set a list of items, which are supplied by the given ListAdapter, to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.
Android reference for android.app.AlertDialog.Builder.setAdapter.
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.