I have a question on how notifyDataSetChanged()
works in a BaseExpandableListAdapter
I am updating a boolean variable, the output of which determines the output of getChildrenCount()
but the number of comments visible does not change on calling it
Code:
buttonViewComments.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
allCommentsVisible = !allCommentsVisible;
notifyDataSetChanged();
}
});
getChildrenCount:
public int getChildrenCount(int groupPosition) {
if(allCommentsVisible || postList.get(groupPosition).commentListSize()<=3)
return postList.get(groupPosition).commentListSize();
else{
return 3;
}
}