Why is ListView.getCheckedItemPositions() not returning correct values?

前端 未结 15 1939
北海茫月
北海茫月 2020-11-29 06:01

The app has a ListView with multiple-selection enabled, in the UI it works as expected. But when I read the values out using this code:

Log.         


        
15条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 06:32

    I remember having an issue with this myself a while back. Here is my previous question, which isn't directly related to your issue, but contains some code that may help. What you might want to try is using checkedPositions.valueAt(int index) rather than checkedPositions.get(int index). I think that may be what you're actually looking for.

提交回复
热议问题