B4X:
Sub Activity_Pause (UserClosed As Boolean)
Log("CheckOut.Activity_Pause")
Globals.SaveSetting(Globals.SETTING_TRUCK_NAME,acetTruck.Text)
Globals.SaveSetting(Globals.SETTING_DRIVER_NAME,etDriver.Text)
Globals.SaveSetting(Globals.SETTING_TRUCK_ODOMETER,etOdometer.Text)
End Sub
The first Globals.SaveSetting is line 63. I get this exception at line 63...
CheckOut.Activity_Pause
Error occurred on line: 63 (CheckOut)
java.lang.NullPointerException: Attempt to read from field 'odp.eljaydelivery.globals odp.eljaydelivery.checkout._globals' on a null object reference
at odp.eljaydelivery.checkout._activity_pause(checkout.java:445)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.ShellBA$2.run(ShellBA.java:115)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5376)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
Settings in module globals is about saving named values with a map, and reading and writing a file with these settings.
Guessing this may be a debugger problem. But it is not cool with this crashing all the time I am testing. Is there ANYTHING I can do to avoid the crashes?