title: Checkboxes in ExpandaleListView
body: <p>I am working with expandablelistview with checkboxes as header and child data.when a user expand a group and checked group header then i want to checked all the child check box as well. i try a number of solution but never to gain.
      please help me thanks in advance.</p>
  
  <pre><code>**my code is like this**
  
  public class ExpandableListAdapter extends BaseExpandableListAdapter {
              private Context _context;
              private List&lt;String&gt; _listDataHeader; 
              private HashMap&lt;String, List&lt;String&gt;&gt; _listChildData;
  
              private HashMap&lt;Integer, boolean[]&gt; mChildCheckStates;
              private ChildViewHolder childViewHolder;
              private GroupViewHolder groupViewHolder;
  
              public ExpandableListAdapter(Context context, List&lt;String&gt; listDataHeader,
                      HashMap&lt;String, List&lt;String&gt;&gt; listChildData) {
                  this._context = context;
                  this._listDataHeader = listDataHeader;
                  this._listChildData = listChildData;
                  mChildCheckStates = new HashMap&lt;Integer, boolean[]&gt;();
              }
  
  
              @Override
              public Object getChild(int groupPosition, int childPosititon) {
                  return this._listChildData.get(this._listDataHeader.get(groupPosition))
                          .get(childPosititon);
              }
  
              @Override
              public long getChildId(int groupPosition, int childPosition) {
                  return childPosition;
              }
  
              @Override
              public View getChildView(int groupPosition, final int childPosition,
                      boolean isLastChild, View convertView, ViewGroup parent) {
                  final int mGroupPosition = groupPosition;
                  final int mChildPosition = childPosition;
  
                  final String childText = (String) getChild(mGroupPosition, mChildPosition);
                  if (convertView == null) {
                      LayoutInflater infalInflater = (LayoutInflater) this._context
                              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                      convertView = infalInflater.inflate(R.layout.childitem, null);
  
                      childViewHolder = new ChildViewHolder();
  
                      childViewHolder.mChildText = (TextView) convertView.findViewById(R.id.childTextView);
  
                      childViewHolder.mCheckBox = (CheckBox) convertView.findViewById(R.id.childcheck);
  
                      convertView.setTag(R.layout.childitem, childViewHolder);
  
                  }else {
  
                      childViewHolder = (ChildViewHolder) convertView.getTag(R.layout.childitem);
                  }
  
                  childViewHolder.mChildText.setText(childText);
  
                  childViewHolder.mCheckBox.setOnCheckedChangeListener(null);
  
                  if (mChildCheckStates.containsKey(mGroupPosition)) {
  
                      boolean getChecked[] = mChildCheckStates.get(mGroupPosition);
  
                      childViewHolder.mCheckBox.setChecked(getChecked[mChildPosition]);
  
                  } else {
                      boolean getChecked[] = new boolean[getChildrenCount(mGroupPosition)];
                      mChildCheckStates.put(mGroupPosition, getChecked);
                      childViewHolder.mCheckBox.setChecked(false);
                  }
  
                  childViewHolder.mCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
  
                      @Override
                      public void onCheckedChanged(CompoundButton buttonView,
                              boolean isChecked) {
                          if (isChecked) {
                              boolean getChecked[] = mChildCheckStates.get(mGroupPosition);
                              getChecked[mChildPosition] = isChecked;
                              mChildCheckStates.put(mGroupPosition, getChecked);
  
                          } else {
  
                              boolean getChecked[] = mChildCheckStates.get(mGroupPosition);
                              getChecked[mChildPosition] = isChecked;
                              mChildCheckStates.put(mGroupPosition, getChecked);
                          }
                      }
                  });
  
                  return convertView;
              }
  
              @Override
              public int getChildrenCount(int groupPosition) {
                  return this._listChildData.get(this._listDataHeader.get(groupPosition))
                          .size();
              }
  
              @Override
              public Object getGroup(int groupPosition) {
                  return this._listDataHeader.get(groupPosition);
              }
  
              @Override
              public int getGroupCount() {
                  return this._listDataHeader.size();
              }
  
              @Override
              public long getGroupId(int groupPosition) {
                  return groupPosition;
              }
  
              @Override
              public View getGroupView( final int groupPosition, boolean isExpanded,
                      View convertView, ViewGroup parent) {
                  String headerTitle = (String) getGroup(groupPosition);
                  if (convertView == null) {
                      LayoutInflater infalInflater = (LayoutInflater) this._context
                              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                      convertView = infalInflater.inflate(R.layout.groupitem, null);
  
                      groupViewHolder = new GroupViewHolder();
                      groupViewHolder.mGroupText = (TextView) convertView.findViewById(R.id.txtview1);
                      convertView.setTag(groupViewHolder);
                  }
                  else {
                      groupViewHolder = (GroupViewHolder) convertView.getTag();
                  }
                  groupViewHolder.mGroupText.setText(headerTitle);
  
                  return convertView;
              }
  
              @Override
              public boolean hasStableIds() {
                  return false;
              }
  
              @Override
              public boolean isChildSelectable(int groupPosition, int childPosition) {
                  return true;
              }
          }
  
          public final class GroupViewHolder {
              TextView mGroupText;
              CheckBox mGroupCheckbox;
          }
  
          public final class ChildViewHolder {
  
              TextView mChildText;
              CheckBox mCheckBox;
          }
  
          public class ListAdapter extends ArrayAdapter&lt;String&gt; {
              private final Context context;
              private final String[] values;
              public ListAdapter(Context context, String[] values) {
                  super(context, R.layout.list, values);
                  this.context = context;
                  this.values = values;
              }
              @Override
              public View getView(int position, View convertView, ViewGroup parent) {
                  LayoutInflater inflater = (LayoutInflater) context
                          .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                  View rowView = inflater.inflate(R.layout.list, parent, false);
                  TextView textView = (TextView) rowView.findViewById(R.id.listdata);
                  textView.setText(values[position]);
                  return rowView;
              }
          }
      }
  </code></pre>