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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With