views:

22

answers:

1

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.

+1  A: 

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;
mbaird
Thank you. That solves it completely.
raybritton