Compartir a través de


AdapterView.IOnItemClickListener.OnItemClick Method

Definition

Callback method to be invoked when an item in this AdapterView has been clicked.

[Android.Runtime.Register("onItemClick", "(Landroid/widget/AdapterView;Landroid/view/View;IJ)V", "GetOnItemClick_Landroid_widget_AdapterView_Landroid_view_View_IJHandler:Android.Widget.AdapterView/IOnItemClickListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void OnItemClick (Android.Widget.AdapterView? parent, Android.Views.View? view, int position, long id);
[<Android.Runtime.Register("onItemClick", "(Landroid/widget/AdapterView;Landroid/view/View;IJ)V", "GetOnItemClick_Landroid_widget_AdapterView_Landroid_view_View_IJHandler:Android.Widget.AdapterView/IOnItemClickListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OnItemClick : Android.Widget.AdapterView * Android.Views.View * int * int64 -> unit

Parameters

parent
AdapterView

The AdapterView where the click happened.

view
View

The view within the AdapterView that was clicked (this will be a view provided by the adapter)

position
Int32

The position of the view in the adapter.

id
Int64

The row id of the item that was clicked.

Attributes

Remarks

Callback method to be invoked when an item in this AdapterView has been clicked.

Implementers can call getItemAtPosition(position) if they need to access the data associated with the selected item.

Java documentation for android.widget.AdapterView.OnItemClickListener.onItemClick(android.widget.AdapterView<?>, android.view.View, int, long).

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