Why does Android's onItemClick want a long for row Id?
Posted
by
HenryAdamsJr
on Stack Overflow
See other posts from Stack Overflow
or by HenryAdamsJr
Published on 2010-12-21T01:32:38Z
Indexed on
2010/12/21
5:21 UTC
Read the original article
Hit count: 498
For a listView, when you register an OnItemClickListener, the method you specify looks like this:
public abstract void onItemClick (AdapterView parent, View view, int position, long id)
The id corresponds to the row that the user clicked on. My question is simply why is it a long and not an int? When would you use it as a long? I've been casting it to an int when I use it, so it makes me think that maybe I'm using it wrong.
© Stack Overflow or respective owner