0

I am fallowing a tutorial and have an error on color saying "color can not be resolved or is not a field". Anyone know the reason for this. Thanks.

lv.setBackgroundColor(callerActivity.getResources().getColor(R.color.Twitter_blue));
Craig Gallagher
  • 235
  • 1
  • 5
  • 19
  • 1
    Possible duplicate of ["id cannot be resolved or is not a field" error?](http://stackoverflow.com/questions/3296047/id-cannot-be-resolved-or-is-not-a-field-error) – Hussein El Feky Jan 22 '16 at 21:15

2 Answers2

2

You need to open "colors.xml" file under the "values" folder and add the color:

 <color name="Twitter_blue">#FF4081</color>

with the relevant colour hex number.

MorZa
  • 2,215
  • 18
  • 33
1

Twitter_blue apparently is not a field in R.color have you tried just using R.color.blue or something similar?

Ben Glasser
  • 3,216
  • 3
  • 24
  • 41