简体   繁体   中英

Android - selected item position in a listview

How can I retrieve the positions of the selected item in a multichoice listView? The getSelectedItemPosition method returns only the first one.

There is at most one selected item in a ListView .

If your ListView is CHOICE_MODE_SINGLE or CHOICE_MODE_MULTIPLE , you can use getCheckedItemPositions() to get the checked ones.

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