Hi, I'm trying to create a context menu that changes the available options depending on which row was clicked.
But I can't figure out how to get the row position in the listview for row that was clicked, until after the menu is created.
Hi, I'm trying to create a context menu that changes the available options depending on which row was clicked.
But I can't figure out how to get the row position in the listview for row that was clicked, until after the menu is created.
It is not obvious at all, but here's the code:
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo)
{
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
int position = info.position;