on methods like these kind, onItemClick(AdapterView parent, View view, int position, long id), what's the difference between position and id.
+2
A:
Well, the id
is, as the name suggests, an identifier, that you can use to identify that specific item in the adapter. Position
refers to the index of the item, in the adapter.
David Hedlund
2009-12-30 15:34:09
In particular, the id will be the _ID column from the Cursor, if you are using some flavor of CursorAdapter.
CommonsWare
2009-12-30 15:42:04
Ah! now i see what the 'id' is for,its the identifier for the data item in the adapter
Raja
2009-12-30 15:54:55
A:
position
is the position of the view in the adapter, while id
is the row id of the item selected.
Anthony Forloney
2009-12-30 15:34:38