0
I am new as Java programmer for Android, I am creating an application that he register an email, in the image below he will register the email and above the user will login.
But when I try to register it generate an error in my save method that is the Insert in the table of the Sqlite database as shown below
12-15 20:35:37.375: I/Process(1830): Sending signal. PID: 1830 SIG: 9
12-15 20:35:40.026: E/Trace(1880): error opening trace file: No such file or directory (2)
12-15 20:35:41.376: D/gralloc_goldfish(1880): Emulator without GPU emulation detected.
12-15 20:37:52.375: D/AndroidRuntime(1880): Shutting down VM
12-15 20:37:52.375: W/dalvikvm(1880): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
12-15 20:37:52.385: E/AndroidRuntime(1880): FATAL EXCEPTION: main
12-15 20:37:52.385: E/AndroidRuntime(1880): java.lang.NullPointerException
12-15 20:37:52.385: E/AndroidRuntime(1880): at com.example.projetologin.repositorio.RepositorioUsuario.salvar(RepositorioUsuario.java:42)
12-15 20:37:52.385: E/AndroidRuntime(1880): at com.example.projetologin.repositorio.RepositorioUsuario.salvar(RepositorioUsuario.java:36)
12-15 20:37:52.385: E/AndroidRuntime(1880): at com.example.projetologin.xml.Login$2.onClick(Login.java:67)
12-15 20:37:52.385: E/AndroidRuntime(1880): at android.view.View.performClick(View.java:4204)
12-15 20:37:52.385: E/AndroidRuntime(1880): at android.view.View$PerformClick.run(View.java:17355)
12-15 20:37:52.385: E/AndroidRuntime(1880): at android.os.Handler.handleCallback(Handler.java:725)
12-15 20:37:52.385: E/AndroidRuntime(1880): at android.os.Handler.dispatchMessage(Handler.java:92)
12-15 20:37:52.385: E/AndroidRuntime(1880): at android.os.Looper.loop(Looper.java:137)
12-15 20:37:52.385: E/AndroidRuntime(1880): at android.app.ActivityThread.main(ActivityThread.java:5041)
12-15 20:37:52.385: E/AndroidRuntime(1880): at java.lang.reflect.Method.invokeNative(Native Method)
12-15 20:37:52.385: E/AndroidRuntime(1880): at java.lang.reflect.Method.invoke(Method.java:511)
12-15 20:37:52.385: E/AndroidRuntime(1880): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-15 20:37:52.385: E/AndroidRuntime(1880): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-15 20:37:52.385: E/AndroidRuntime(1880): at dalvik.system.NativeStart.main(Native Method)
here is my project on Github
https://github.com/wladyband/CadastroEmail
how do I correct this error?
Your code does not appear here, put your save function and indicate which line 25.
– Jorge B.
@Jorgeb. Why line 25?? Didn’t you mean 42? 42 is the answer to everything, forgot?
– Math
I was wrong @Math ;)
– Jorge B.
java.lang.NullPointerException at com.example.projetologin.repositorio.RepositorioUsuario.salvar(RepositorioUsuario.java:42)
, yes, 42 is the answer to everything hehehe.– Anthony Accioly
24 is also a cabalistic number.
– Anthony Accioly