1

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?

Roy Sharon
  • 3,488
  • 4
  • 24
  • 34
Nik Tsekouras
  • 289
  • 2
  • 15
  • may be of use http://stackoverflow.com/questions/6711592/what-is-the-intent-of-the-methods-getitem-and-getitemid-in-the-android-class-bas – Cel Oct 04 '12 at 10:33
  • see this question http://stackoverflow.com/questions/6711592/what-is-the-intent-of-the-methods-getitem-and-getitemid-in-the-android-class-bas – aka_sh May 15 '14 at 12:22

0 Answers0