Pergunta

actually I'm developping an android application .The problem that I want to change the background color for a TextView using a color code that is exported from my database but it works only with CSS (bgcolor), I tried a few kinds of conversions but I n 'I could not solve this problem thank you for helping me examples of color codes from my database : #66FF33 , #CC99FF

Foi útil?

Solução

I am assuming your database stores the color in a String format... try this:

theViewYouWishToChange.setBackgroundColor(Color.parseColor(myStringWithAColor));

Outras dicas

Color.parseColor("#rrggbb")

i think this is what you want right?

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top