I have a problem , ı want to add different icons for each element in expandableList like that;
- Icon1 Main 1
- Icon2 Sub1
- Icon3 Sub2
- Icon4 Main 2
- Icon5 Sub3
- Icon6 Sub4
- Icon7 Main 3
- Icon8 Sub5
- Icon9 Sub6
Is it possible?
Yes it is possible. You’ll need two different layout xml files. One for the Parent view, and another for the child view. (or just one if the layout is the same, only with different data filling it).
Then inflate your layouts on the methods getChildView() and getGroupView(); and fill the icons with the drawables you want. Either from resources or from web, or whatever.
If you have trouble with expandable list view try following this tutorial: