I am trying to take an expandable list view that I have already created and change the color of the background of one of the items in the list of groups. I only want to change the color of the entry in the main list, not its drop down children, aka the part that you click on to expand or hide the other parts. I think getGroupView will do this, but I can’t figure out how to make this work. If this is the proper method to use, can someone explain how to use it? If there is a better way, what is it?
[Edit] I played around with it some more, and figured out how to use getGroupView somewhat, but I am still having a problem. What I am doing to my understanding should be only changing the color of a single entry, but instead it changes them all. Here is the code:
View listViewRow = findViewById(R.layout.menu_item);
listViewRow = myNewAdapter.getGroupView(2, false, listViewRow, expandView);
listViewRow.setBackgroundColor(Color.RED);
where menu_item is the name of the layout file that I am using for the groups in the expandable list, and expandView is the expandableListView.
try with this in extended BaseExpandableListAdapter class
OR refrer this