OnItemClickListener中的position和id有什么区别

publicvoidonItemClick(AdapterView<?>parent,Viewview,intposition,longid)调试时候发现position... public void onItemClick(AdapterView<?> parent, View view, int position, long id)调试时候发现position与是一样的。 展开
 我来答
蒙蓉7693
2014-04-27 · TA获得超过347个赞
知道答主
回答量:148
采纳率:0%
帮助的人:161万
展开全部
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至于说值一样应该是他们的位置一样 查看原帖>>
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
SO赋壤7
2014-04-27 · TA获得超过116个赞
知道答主
回答量:133
采纳率:60%
帮助的人:59.5万
展开全部
position 相当于 index,在 adapter 里的次序id 一个身份标识,如果是用 CursorAdapter,则为 Cursor 里的 _ID 字段值 查看原帖>>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式