Reputation: 6824
In methods like these kind,
onItemClick(AdapterView<?> parent, View view, int position, long id)
,
what's the difference between position
and id
.
Upvotes: 0
Views: 1358
Reputation: 91786
position
is the position of the view in the adapter, while id
is the row id of the item selected.
Upvotes: 0
Reputation: 129792
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.
Upvotes: 3