Android ExpandableListView with Checkbox, Controlling checked state

前端 未结 4 1729
温柔的废话
温柔的废话 2020-12-03 18:07

Friends,

I am trying to write a application which use checkbox in ExpandableListView, I got a problem here which is maintaining checkbox state of the application, I

4条回答
  •  北海茫月
    2020-12-03 18:45

    I also have this problem. Finally I found the root cause and the solution. To fix this, instead of setting the checkState for the checkBox, you should set its containing listView's checkState.

        public class MyExpandableListViewAdapter extends BaseExpandableListAdapter {
     ....
    
        private boolean[][] checkedState;
    
        private void prepareData() {
              checkedState =new boolean[itemData.length][]; 
    
              for (int i=0; i

提交回复
热议问题