0
votes

In android, I have a List Activity (subclass from ListActivity). And i want to add a context menu for each item in the list view. So I overload public boolean onContextItemSelected(MenuItem item), but from that method, how can I find out the actual view that user has clicked to invoke the context menu? The view of an item in the listview?

Thank you.

1

1 Answers

0
votes

michael,

in onContextItemSelected() you want to call

AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();

then the item that was clicked on will be stored in info.id