Advertisement
Guest User

ExpandableListView uncheck all checkboxes - NOT WORKING

a guest
Oct 26th, 2013
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1.     ExpListView.setOnChildClickListener(new OnChildClickListener() {
  2.  
  3.         @Override
  4.         public boolean onChildClick(ExpandableListView parent, View v,
  5.                 int groupPosition, int childPosition, long id) {
  6.             MyListAdapter adapter = (MyListAdapter) parent
  7.                     .getExpandableListAdapter();
  8.  
  9.             for (int i = 0; i < adapter.getChildrenCount(groupPosition); i++) {
  10.                 View view2 = (View) adapter.getChildView(groupPosition, i,
  11.                         false, v, parent);
  12.                 CheckBox cb2 = (CheckBox) view2.findViewById(R.id.checkbox);
  13.                 cb2.setChecked(false);
  14.             }
  15.             parent.invalidateViews(); // Update the list view
  16.  
  17.             CheckBox cb = (CheckBox) v.findViewById(R.id.checkbox);
  18.             cb.setChecked(true);
  19.             return false;
  20.         }
  21.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement