Hi everybody.
Crashlytics gave me the following error. It has happened only 3 times on a Nokia 3.1 with Android 9.
The line "service1.java:229" in service1.java should be the following:
And it should correspond to the StartForeground line below:
Am I doing something wrong?
Can someone give to me an advice?
Thanks a Lot.
Crashlytics gave me the following error. It has happened only 3 times on a Nokia 3.1 with Android 9.
Fatal Exception: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to read from field 'anywheresoftware.b4a.objects.ServiceHelper it.ritmo.setandgo.service1._service' on a null object reference
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:233)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at it.ritmo.setandgo.service1.handleStart(service1.java:100)
at it.ritmo.setandgo.service1.access$000(service1.java:8)
at it.ritmo.setandgo.service1$2.run(service1.java:80)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6715)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
Caused by java.lang.NullPointerException: Attempt to read from field 'anywheresoftware.b4a.objects.ServiceHelper it.ritmo.setandgo.service1._service' on a null object reference
at it.ritmo.setandgo.service1._service_start(service1.java:229)
at java.lang.reflect.Method.invoke(Method.java)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at it.ritmo.setandgo.service1.handleStart(service1.java:100)
at it.ritmo.setandgo.service1.access$000(service1.java:8)
at it.ritmo.setandgo.service1$2.run(service1.java:80)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6715)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
The line "service1.java:229" in service1.java should be the following:
B4X:
mostCurrent._service.StartForeground((int) (1),(android.app.Notification)(_vvvvvvvvvvvvvvvvvvvvvvvvvvv0.getObject()));
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim nNotify As Notification
End Sub
Sub Service_Create
nNotify.Initialize
nNotify.Icon = ""
nNotify.Sound=False
nNotify.Vibrate=False
nNotify.Light=False
nNotify.OnGoingEvent=True
nNotify.SetInfo("", "", "")
End Sub
Sub Service_Start (StartingIntent As Intent)
Service.StartForeground(1,nNotify)
'.......
Can someone give to me an advice?
Thanks a Lot.