I’m trying to parse an ARGB hex String to an int but it’s not working.
My code:
int color = Integer.parseInt("ff686868", 16);
Exception:
java.lang.NumberFormatException: unable to parse 'ff686868' as integer
at java.lang.Integer.parse(Integer.java:438)
at java.lang.Integer.parseInt(Integer.java:422)
...
When I try to parse a normal RGB String like 686868 it does work but when I add the alpha it breaks down. I hope someone can help me.
The number would be too big for integer.
Use:
Long.parseLong(..)