Craig Gallagher
Craig Gallagher

Reputation: 235

color can not be resolved or is not a field

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));

Upvotes: 0

Views: 801

Answers (2)

MorZa
MorZa

Reputation: 2325

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.

Upvotes: 2

Ben Glasser
Ben Glasser

Reputation: 3355

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

Upvotes: 1

Related Questions