Skip to content Skip to sidebar Skip to footer

Contextmenu Initiated From Gridview

Just wondering if anyone can help with this - I'm learning and unable to figure it out...... If I register a GridView object with a Context Menu as follows: registerForContextMenu(

Solution 1:

In onContextItemSelected() method, you can get the index of the item on the Grid by using:

AdapterView.AdapterContextMenuInfoinfo= (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();
intindex= info.position;

Then use this index for everything you want :)

Post a Comment for "Contextmenu Initiated From Gridview"