[英]Android - selected item position in a listview
How can I retrieve the positions of the selected item in a multichoice listView? 如何在多选listView中检索所选项目的位置? The
getSelectedItemPosition
method returns only the first one. getSelectedItemPosition
方法仅返回第一个。
There is at most one selected item in a ListView
. ListView
中最多有一个选定的项目。
If your ListView
is CHOICE_MODE_SINGLE
or CHOICE_MODE_MULTIPLE
, you can use getCheckedItemPositions()
to get the checked ones. 如果您的
ListView
是CHOICE_MODE_SINGLE
或CHOICE_MODE_MULTIPLE
,则可以使用CHOICE_MODE_MULTIPLE
getCheckedItemPositions()
来获取选中的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.