I am trying to copy an item text from a list view using onCreateContextMenu OnCreateContextMenu and ListView items and Copy text from TextView on Android but I don't know how to relate the click on the copy in the menu to the listView.
My current code, open up a menu with copy, and I have no idea how to get the text after copy was clicked
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.add(0, v.getId(), 0, "copy");
}
@Override
public boolean onContextItemSelected(MenuItem item) {
if(item.getTitle()=="copy"){}
else {return false;}
return true;
}
thank you for your help