I’m getting this error in my code:
Error: No resource found that matches the given name (at ‘background’ with value @color/red’).
Here is my TextView:
<TextView
android:id="@+id/tv01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/prizeFund"
android:background="@color/red">
</TextView>
And the color definition, in colors.xml in res/values:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red">#ff0000</color>
<color name="green">#00ff00</color>
<color name="blue">#0000ff</color>
</resources>
Try to clean your project The
R.javafile will be regenerated for youOn eclipse go to Project—->Clean..
also the resources must be in strings.xml not colors.xml
below an exemple of the strings.xml file