I am receiving hex color values from a server (in this form, #xxxxxx , example #000000 for black)
How do I convert this to an integer value
I was facing the same problem. This way I was able to solved it. As CQM said, using Color.parseColor() is a good solution to this issue.
Here is the code I used:
this.Button_C.setTextColor(Color.parseColor(prefs.getString("color_prefs", String.valueOf(R.color.green))));
In this case my target was to change the Button's text color (Button_C) when I change the color selection from my Preferences (color_prefs).