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

前端 未结 15 1940
北海茫月
北海茫月 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:23

    None of the above solutions have worked for me, instead I get every child (a checkedTextView) from the ListView and see if it is checked or not:

                ListView myListView = myViewActivity.getListView();
            ArrayList selectedChildren2 = new ArrayList();
    
            for(int i = 0;i

提交回复
热议问题