In my application I used a converter to create from 3 values > RGB-colors an Hex value. I use this to set my gradient background in my application during runtime.
Now is this the following problem.
The result of the converter is a (String)
#45E213
, and this can't be stored in an integer.
But when you create an integer,
int hex = 0x45E213;
it does work properly, and this doesn't give errors.
Now I knew of this, I Replaced the #
to 0x
, and tried it to convert from String to Integer.
int hexToInt = new Integer("0x45E213").intValue();
But now I get the numberFormatException
, because while converting, it will not agree with the character E
?
How can I solve this? Because I really need it as an Integer or Java/Eclipse won't use it in its method.