1
I’m trying to register a client in Android internal comic book. I have a field String
where I put the user’s phone. This field I do the conversion to Integer using the parseInt
newCliente.setFone(Integer.parseInt(foneDesc));
If I register at most two phone numbers for the user it accepts (it was the example I used). But if I type the 9 digits of the phone that is correct it gives error:
FATAL EXCEPTION: main java.lang.NumberFormatException: Invalid int: "4899984829" at java.lang.Integer.invalidInt(Integer.java:138) at java.lang.Integer.parse(Integer.java:378) at java.lang.Integer.parseInt(Integer.java:366) at java.lang.Integer.parseInt(Integer.java:332) at artur.com.decorusfinal.cadastro.CadCliente$btGravar.onClick(CadCliente.java:68) at android.view.View.performClick(View.java:4204) at android.view.View$PerformClick.run(View.java:17355) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method)
In error it gives says problem is in conversion
newCliente.setFone(Integer.parseInt(foneDesc));
If it had not worked he would not even let me register the user with only 2 phone numbers.
I think there’s a piece missing from the table
– Jéf Bueno
@jbueno edited the answer already with the other table.
– Marco Giovanni
Now yes. Good answer +1
– Jéf Bueno