Tano
Tano

Reputation: 619

Android Expandable ListView Image

I am following a tutorial for a listview, this one here (in section 16)and my question is how I can change the icons for each category I have, for example for Test 1 I want to have different image, for Test 2 different and so on.

Upvotes: 0

Views: 32

Answers (1)

Danail Alexiev
Danail Alexiev

Reputation: 7772

The UI hierarchy for your group view is created in the getGroupView() method. If you want to change how things look, you should focus there.

From what I can see, you will probably need to expose a method for changing the icon in CheckedTextView.

Next, you'll need to implement some logic to determine the right icon per group. You can do that in a number of ways - you can check the name of each group and select the right drawable, or you can introduce another unique identifier to the group model class to help you decide which icon to show.

Upvotes: 1

Related Questions