Not sure where it comes to nor the title of this thread.
I have in B4XMainPage declared in Class_Globals:
When B4XMain is created, I have a small delay, then I call a sub, which within it lines executes:
The wierd thing, is that the logs outputs:
So it argues that a B4XView, that returns false if it is initialized, but then within the if IsInitialized it crashes, even thow teh LOG() before showed it was false the condition. Moreover it argues that the object should first be initialized (List). When pnlPager is not a "List" but a B4XView.
There is no other part in the code that assigns a value to pnlPager
I have in B4XMainPage declared in Class_Globals:
B4X:
Dim pnlPager As B4XView
When B4XMain is created, I have a small delay, then I call a sub, which within it lines executes:
B4X:
Log(pnlPager.IsInitialized)
If pnlPager.IsInitialized Then '<--Line 1259
pnlPager.RemoveViewFromParent
End If
The wierd thing, is that the logs outputs:
B4X:
false
Error occurred on line: 1259 (B4XMainPage)
java.lang.RuntimeException: Object should first be initialized (List).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.collections.List.getSize(List.java:129)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:22)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1714)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8178)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
So it argues that a B4XView, that returns false if it is initialized, but then within the if IsInitialized it crashes, even thow teh LOG() before showed it was false the condition. Moreover it argues that the object should first be initialized (List). When pnlPager is not a "List" but a B4XView.
There is no other part in the code that assigns a value to pnlPager