我在列表视图上设置了一个长点击监听器,我想使用被点击项目的索引来检索相应的对象。
public abstract boolean onItemLongClick (AdapterView<?> parent, View view, int position, long id)
Parameters
parent The AbsListView where the click happened
view The view within the AbsListView that was clicked
position The position of the view in the list
id The row id of the item that was clicked
我的问题是“位置”和“id”总是一样的吗?这些定义似乎可以互换,那么有什么区别呢?