views:

42

answers:

1

I just tried this example. I saved that code in res/color/hover.xml but I always get this error message and Eclipse won't compile my project with this xml. What am I doing wrong?

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
<item android:state_pressed="true"
          android:color="#ffff0000"/> <!-- pressed -->
    <item android:state_focused="true"
          android:color="#ff0000ff"/> <!-- focused -->
    <item android:color="#ff000000"/> <!-- default -->
</selector> <!-- Error Message -->

Error parsing XML: not well-formed (invalid token) hover.xml /MmAndroid/res/color line 8 Android AAPT Problem

The only thing I might not have done is following. I don't know how to do that:

compiled resource datatype: Resource pointer to a ColorStateList.

+1  A: 

you have to put this xml file inside the drawable folder. not in res/color

Praveen Chandrasekaran
Thank you for the quick answer! How stupid, that they have such major mistakes in their examples on android.com!
OneWorld