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

有帮助吗?

解决方案

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

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

其他提示

Color.parseColor("#rrggbb")

i think this is what you want right?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top