
OnItemClickListener中的position和id有什么区别
publicvoidonItemClick(AdapterView<?>parent,Viewview,intposition,longid)调试时候发现position...
public void onItemClick(AdapterView<?> parent, View view, int position, long id)调试时候发现position与是一样的。
展开
展开全部
Parametersparent: The AdapterView where the click happened. view: The view within the AdapterView that was clicked (this will be a view provided by the adapter) position: The position of the view in the adapter. id: The row id of the item that was clicked. 上面是api文档里参数的解释。position是你点击的view在adapter的位置,id表示是你点击的第几行item至于说值一样应该是他们的位置一样 查看原帖>>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
position 相当于 index,在 adapter 里的次序id 一个身份标识,如果是用 CursorAdapter,则为 Cursor 里的 _ID 字段值 查看原帖>>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询