Grabbing the list item TextView value when ContextMenu is opened
问题 On a ListView single/short click, I can do this: protected void onListItemClick(ListView listView, View v, int position, long id) { tvInt = reviews.get(position); } How would I do this for a ContextMenu ? My ListView simply contains a single TextView . Edit: I want to grab the value of the TextView in the ListView , not the ContextMenu . 回答1: The MenuItem packs extra information from where you could extract the position of the clicked row in the ListView and then simply use the code you used