Why does referencing a color from the resource folder for the background color work, but not specifying a hex value?

Viewed 21

Having <item name="android:colorBackground">@color/bg</item>(where <color name="bg">#f0f0ff</color> is the color) in a style in the style.xml file causes the correct color to show in the background:

correct color

But having <item name="android:colorBackground">#f0f0ff</item> does not work:

incorrect color

Anyone know why?

0 Answers
Related