I have a listview which has some listItems in it. I have registered the listview for context menu using registerForContextMenu(mListView);. Now what I want is that, if the user long presses on the first item of the listview, the context menu for that item should not be shown, but for all the rest items, it should popup the context menus if the user long presses on them. Can we do this?
I have a listview which has some listItems in it. I have registered the
Share
Instead, i would suggest you to use
OnItemLongClickListenerwhich will return position value of long-pressed item. By considering that value, you may decide either to show dialog with list of options or just ignore it.For example: