tags:

views:

309

answers:

2

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
In particular, the id will be the _ID column from the Cursor, if you are using some flavor of CursorAdapter.
CommonsWare
Ah! now i see what the 'id' is for,its the identifier for the data item in the adapter
Raja
A: 

position is the position of the view in the adapter, while id is the row id of the item selected.

Anthony Forloney