hi i am using a list fragment that is populated from a simpleCursorAdapter
.
At onCreateContextMenu
and onContextItemSelected
i need the name of the list item and the id respectively. I am getting the correct results with these commands:
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
String name = ((Cursor) adapter.getItem(info.position)).getString(1).toString();
and
((Cursor) adapter.getItem(info.position)).getInt(0).
the cursor from the query has first returned column _id
and second name
.(explaining getString(1),getInt(0)).
My question is why and when should i use getItemId
. What should i get?