So right now I'm building an app on competitive Pokemon, and right now I am having issues getting specific background colors depending on the text views. The layout, essentially, will be the Pokemon name followed by the type; I want the type to be associated with a certain color. Grass will be green, Electric is yellow, etc. The idea is that the type will show up next to the Pokemon name.
I don't really know how to do it in XML, so what I did in the code was created an associative array for the types, as well as the colors. I mapped each type to a color, and tried setting the backgrounds, but no background color is showing up. Below is all relevant code: