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.
I think you should use
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
Object obj = parent.getTag();
if(obj instanceof View){
((View) obj).findViewByID().setBackgroundColor(Color.);
}
v.findViewByID().setBackgroundColor(Color.DKGRAY);
parent.setTag(v);
return false;
}
parent.getChildAt(childPosition).findViewByID().setBackgroundColor(Color.DKGRAY);
or
v.findViewByID().setBackgroundColor(Color.DKGRAY);
for second one http://developer.android.com/reference/android/widget/ExpandableListView.OnChildClickListener.html#onChildClick(android.widget.ExpandableListView, android.view.View, int, int, long)