In my application, I used a converter to create a Hex value from 3 values> RGB colors. I use this to set my gradient background in my application at runtime.
Now this is the next problem. The result of the conversion is (String) #45E213, and it cannot be stored as an integer. But when you create an integer,
int hex = 0x45E213;
It works correctly and it does not give errors.
Now I knew about it, I replaced it #with 0xand tried to convert it from String to Integer.
int hexToInt = new Integer("0x45E213").intValue();
But now I get numberFormatException, because when converting it will not agree with the symbol E?
How can i solve this? Since I really need it, because Integer or Java / Eclipse will not use it in their method.
source
share