I get the field in this format:

"percent_home_color":"#65ff65"

I need to change the background color of the view , but setBackground wants an int .

Question: Is there a function for this or to write manually for transfer to the decimal system?

    1 answer 1

     int color = Color.parseColor(String color); 

    Link to of. documentation

    P. C, you need not from JSON, but from a string, since you must first get the string "percent_home_color":"#65ff65" from JSON

    • thanks, that is necessary! - Taras Zhupnik