Arcadia
Arcadia

Reputation: 266

Changing Expandable ListView default icons

I'm trying to change the default minimized and maximized icons for an expandable listview. I followed this tutorial closely, but I keep getting the following error in the expander_group.xml file:

error: Error: No resource found that matches the given name (at 'icon' with value '@android:drawable/expander_ic_minimized.9').

The expander_group.xml file looks like this:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item
    android:state_expanded="true"
    android:drawable="@drawable/expander_ic_maximized.9"/>
  <item
    android:icon="@android:drawable/expander_ic_minimized.9" />
 </selector>

As you can se in the above snippet, I have tried with both having a local copy of "expander_ic_maximized.9.png" in the res/drawable-hdpi folder and referencing the system icon but both scenarios yields the same error.

Hope someone can clarify the problem and help find a solution :)

Upvotes: 1

Views: 1400

Answers (2)

Shaista Naaz
Shaista Naaz

Reputation: 8321

In the res/drawable-hdpi folder, rename the folder to "expander_ic_maximized.png" instead of "expander_ic_maximized.9.png"

Upvotes: 0

Alex Curran
Alex Curran

Reputation: 8828

The ".9" parts don't need to be put in the resource identifier :)

Upvotes: 2

Related Questions