0

I am getting the following exception on a selector xml file which I have defined as the background for a custom button.

org.xmlpull.v1.XmlPullParserException: Binary XML file line #8: <item> tag requires a 'drawable' attribute or child tag defining a drawable

The file is as follows:

<?xml version="1.0" encoding="utf-8"?>
<selector 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http//schemas.android.com/apk/res/com.toucans.negevsales">
<item 
    android:state_pressed="true"
    app:state_expanded="false"
    android:drawable="@drawable/plus_pressed" /> 
<item 
    android:state_pressed="false"
    app:state_expanded="false"
    android:drawable="@drawable/plus" />
<item 
    android:state_pressed="true"
    app:state_expanded="true"
    android:drawable="@drawable/minus_pressed" />
<item 
    android:state_pressed="false"
    app:state_expanded="true"
    android:drawable="@drawable/minus" />
</selector>

Am I missing some decoration? I followed this answer to create my custom button, but the image is not toggling, and the exception seems to be thrown at render time, not at run time. What is wrong here?

Community
  • 1
  • 1
Aharon Manne
  • 712
  • 3
  • 11
  • 34
  • do you have a drawable by the name `plus_pressed` is the drawable folder? – Raghunandan Mar 06 '14 at 16:23
  • 1
    [See this stack question for possible answer.][1] Have you run it on a device? [1]: http://stackoverflow.com/questions/8114322/error-item-tag-requires-a-drawable-attribute-or-child-tag-defining-a-drawa – Phoenix Mar 06 '14 at 19:28

0 Answers0