I am receiving hex color values from a server (in this form, #xxxxxx , example #000000 for black)
#xxxxxx
#000000
How do I convert this to an integer value
Get Shared Preferences Color Code in String then Convert to integer and add layout-background color:
sharedPreferences = getSharedPreferences(mypref, Context.MODE_PRIVATE); String sw=sharedPreferences.getString(name, ""); relativeLayout.setBackgroundColor(Color.parseColor(sw));