简体   繁体   中英

AdapterView.OnItemClickListener

In methods like these kind,

onItemClick(AdapterView<?> parent, View view, int position, long id) ,

what's the difference between position and id .

Well, the id is, as the name suggests, an identifier, that you can use to identify that specific item in the adapter. Position refers to the index of the item, in the adapter.

position是视图在适配器中的位置,而id是所选项目的行ID。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM