I have a string array in strings.xml which is an array of color name. And, I listed colors in colors.xml with the same name as the array item. Now, I am trying to set the background of view using the color name (string) from strings.xml. How can i do that?
<color name="aliceBlue">#F0F8FF</color>
<color name="antiqueWhite">#faebd7</color>
<color name="antiqueWhite1">#ffefdb</color>
<color name="antiqueWhite2">#eedfcc</color>
<color name="antiqueWhite3">#cdc0b0</color>
<color name="antiqueWhite4">#8b8378</color>
<color name="aquaMarine1">#7fffd4</color>
<color name="aquaMarine2">#76eec6</color>
<color name="aquaMarine4">#458b74</color>
<color name="azure1">#f0ffff</color>
<color name="azure2">#e0eeee</color>
<color name="azure3">#c1cdcd</color>
<color name="azure4">#838b8b</color>
color.xml
<string-array name="colorNameArray">
<item>AliceBlue</item>
<item>AntiqueWhite</item>
<item>AntiqueWhite1</item>
<item>AntiqueWhite2</item>
<item>AntiqueWhite3</item>
<item>AntiqueWhite4</item>
<item>aquamarine1</item><item>
aquamarine2</item>
<item>aquamarine4</item>
<item>azure1</item>
<item>azure2</item>
<item>azure3</item>
<item>azure4</item>
strings.xml
Please guys, your help is appreciated.
No comments:
Post a Comment