• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

satyamurthy

Hi,
I have Hexadecimal value and need to assign to a button's background by setBackgroundColor(),but getting Runtime Exception: see the code snippet below with exception output. Please help me resolve this

String strColor="0xFFF3ECE0";
int intColor= Integer.parseInt(strColor,16);
button1.setBackgroundColor(intColor);

ERROR/AndroidRuntime(874): java.lang.NumberFormatException: unable to parse '0xFFF3ECE0' as integer
 
Back
Top Bottom