I don't understand why Eclipse doesn't know how to resolve the color resources I've defined. Am I doing something wrong?
R.color.notepad_lines cannot be resolved MyNewTextView.java
I've had problems before too with eclipse being able to find images in my /res/drawable directory
/res/values/colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="notepad_paper">#AAFFFF99</color>
<color name="notepad_lines">#FF0000FF</color>
<color name="notepad_margin">#90FF0000</color>
<color name="notepad_text">#AA0000FF</color>
</resources>
MyNewTextView.java
...
private Paint marginPaint;
private Paint linePaint;
private int paperColor;
private float margin;
private void init(){
//Get Reference to Resource Table
Resources myRes = getResources();
//Create paint brushes
marginPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
marginPaint.setColor(myRes.getColor(R.color.notepad_margin));
linePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
linePaint.setColor(myRes.getColor(R.color.notepad_lines));
paperColor = myRes.getColor(R.color.notepad_paper);
margin = myRes.getDimension(R.dimen.notepad_margin);
}
...
Eclipse keeps saying it can't find any of the R.* resources =/
R.java
public final class R {
public static final class attr {
}
public static final class color {
public static final int notepad_lines=0x7f040001;
public static final int notepad_margin=0x7f040002;
public static final int notepad_paper=0x7f040000;
public static final int notepad_text=0x7f040003;
}
public static final class dimen {
public static final int notepad_margin=0x7f050000;
}
public static final class drawable {
public static final int ic_menu_add=0x7f020000;
public static final int ic_menu_cut=0x7f020001;
public static final int ic_menu_king=0x7f020002;
public static final int icon=0x7f020003;
}
...