Possible causes: Onitemlongclick consumption of long press events
mListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
/span>public boolean Onitemlongclick adapterview <?> parent view View , Span class= "PLN" > int position long ID ) Span class= "PLN" > {
mApSelect = position;
Log.d(TAG, "onItemLongClick:" + mApSelect);
return false;
}
});
Key inOnitemlongclickThe return value of the function, see the document Comment:
/**
* 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.
*
* @param parent The AbsListView where the click happened
* @param view The view within the AbsListView that was clicked
* @param position The position of the view in the list
* @param id The row id of the item that was clicked
*
* @return true if the callback consumed the long click, false otherwise
*/
If Ture is returned, the system considers that the user-implemented callback function has finished processing the long-press event. The popup ContextMenu is also a long-press-event response, and theOnitemlongclickAfter the response, returning true causes ContextMenu not to eject.
From for notes (Wiz)
Android Long Press the ListView cannot eject Contextmeun