Hi there,
I try to convert the Msgboxes to MsgboxAsync. Since there are some MsgBoxes one after the other, I try to de-parallelize them with Wait For.
Now I got a crash:
The code is quite complex.
The original call is in Main.Activity_Create. It calls a resumable sub (well, since I need Wait For, many subs have to be resumable) called pruefeLizenz. That one calls leseDatei in the Class LizenzClass. The instance of this class is declared in Main.Process_Globals and initialized in Starter.
In this sub, the App crashes while calling an simple MsgboxAsync.
I tried to create a litte App, which mimic the behaviour of the original app to show the crash; but this app works as expected.
I have no idea what could happen there. I am quite shure the logical flow is correct; I think it has something to do with the resumable sub / async thing and perhaps a problem with the right context.
Has anybody an idea what's going wrong?
Thank you.
I try to convert the Msgboxes to MsgboxAsync. Since there are some MsgBoxes one after the other, I try to de-parallelize them with Wait For.
Now I got a crash:
Stack trace:
lizenzclass$ResumableSub_leseDateiresume (java line: 213)
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference
at anywheresoftware.b4a.keywords.Common.Msgbox2Async(Common.java:488)
at anywheresoftware.b4a.keywords.Common.MsgboxAsync(Common.java:466)
at de.xxx.yyy.lizenzclass$ResumableSub_leseDatei.resume(lizenzclass.java:213)
at de.xxx.yyy.lizenzclass._lesedatei(lizenzclass.java:125)
at de.xxx.yyy.main$ResumableSub_findeLizenz.resume(main.java:2797)
at de.xxx.yyy.main._findelizenz(main.java:2633)
at de.xxx.yyy.main$ResumableSub_pruefeLizenz.resume(main.java:3220)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:250)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:190)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.keywords.Common$1.onClick(Common.java:492)
at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:169)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6251)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference
The code is quite complex.
The original call is in Main.Activity_Create. It calls a resumable sub (well, since I need Wait For, many subs have to be resumable) called pruefeLizenz. That one calls leseDatei in the Class LizenzClass. The instance of this class is declared in Main.Process_Globals and initialized in Starter.
In this sub, the App crashes while calling an simple MsgboxAsync.
I tried to create a litte App, which mimic the behaviour of the original app to show the crash; but this app works as expected.
I have no idea what could happen there. I am quite shure the logical flow is correct; I think it has something to do with the resumable sub / async thing and perhaps a problem with the right context.
Has anybody an idea what's going wrong?
Thank you.