AdapterView.IOnItemLongClickListener.OnItemLongClick Method

Definition

Callback method to be invoked when an item in this view has been clicked and held.

[Android.Runtime.Register("onItemLongClick", "(Landroid/widget/AdapterView;Landroid/view/View;IJ)Z", "GetOnItemLongClick_Landroid_widget_AdapterView_Landroid_view_View_IJHandler:Android.Widget.AdapterView/IOnItemLongClickListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool OnItemLongClick (Android.Widget.AdapterView? parent, Android.Views.View? view, int position, long id);
[<Android.Runtime.Register("onItemLongClick", "(Landroid/widget/AdapterView;Landroid/view/View;IJ)Z", "GetOnItemLongClick_Landroid_widget_AdapterView_Landroid_view_View_IJHandler:Android.Widget.AdapterView/IOnItemLongClickListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OnItemLongClick : Android.Widget.AdapterView * Android.Views.View * int * int64 -> bool

Parameters

parent
AdapterView

The AbsListView where the click happened

view
View

The view within the AbsListView that was clicked

position
Int32

The position of the view in the list

id
Int64

The row id of the item that was clicked

Returns

true if the callback consumed the long click, false otherwise

Attributes

Remarks

Callback method to be invoked when an item in this view has been clicked and held.

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

Java documentation for android.widget.AdapterView.OnItemLongClickListener.onItemLongClick(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