I want to change the background color of the child which is clicked in an ExpandableListView. That is, when any child is clicked, it\'s background color should get changed.
This is how I solved it.
View _lastColored;
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
_groupPosition = groupPosition;
if(_lastColored != null)
{
_lastColored.setBackgroundColor(Color.TRANSPARENT);
_lastColored.invalidate();
}
_lastColored = v;
v.setBackgroundColor(Color.rgb(214, 214, 214));
return false;
}