I have an ExpandableListView with a checkbox next to group name and when expanded, child items with checkbox as well.
Let\'s suppose I have 4 groups with 50 childs.
I've found the solution. Instead of using OnCheckedChangeListener on the groupcheckbox, I used OnClickListener and it solved everything like this :
gholder.groupcheckbox.setChecked(array.get(groupPosition).isCheck());
gholder.groupcheckbox.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
for(int i = 0;i<array.get(groupPosition).getContacts().size();i++){
array.get(groupPosition).getContacts().get(i).setCheck(gholder.groupcheckbox.isChecked());
}
array.get(groupPosition).setCheck(gholder.groupcheck.isChecked());
notifyDataSetChanged();
}
});