【发布时间】:2011-12-13 04:19:09
【问题描述】:
我在列表视图上设置了一个长点击监听器,我想使用被点击项目的索引来检索相应的对象。
根据android docs的方法签名和参数定义
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
我的问题是“位置”和“身份”总是相同的吗?这些定义似乎可以互换,那么有什么区别呢?
【问题讨论】:
标签: android onlongclicklistener android-adapterview