The way I see it fMapTileManager has already been initialized (an in turn initialized the db) before you call setFileName.
You could possibly shift thefMapTileManager.Initialize to the setFileName sub
What changes have you made to the fMapTileManager class ... ? ( Initialize sub, FileName variable , InitDB sub etc)
Public Sub Initialize
dbInit
End Sub
'open db, create it if necessary
Private Sub dbInit
fXUI.SetDataFolder("")
If Not(File.Exists(fXUI.DefaultFolder,"tiles.db3")) Then
#if B4A or B4i
fDB.Initialize(fXUI.DefaultFolder,"tiles.db3",True)
'........................................
.
If I shift the fMapTileManager.Initialize to the setFileName sub, it will error out.
b4xpagesmanager._vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv1 (java line: 312)
java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:523)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:469)
at b4j.example.b4xpagesmanager._vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv1(b4xpagesmanager.java:312)
at b4j.example.b4xpagesmanager._vvv2(b4xpagesmanager.java:727)
at b4j.example.b4xpagesmanager._v7(b4xpagesmanager.java:118)
at b4j.example.b4xpagesmanager._v0(b4xpagesmanager.java:125)
at b4j.example.b4xpagesmanager._initialize(b4xpagesmanager.java:496)
at b4j.example.main._appstart(main.java:63)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.start(main.java:37)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.NullPointerException
at b4j.example.cvmap._setvvvvvvvvvvvvvvvvvvvvvvvv7(cvmap.java:1311)
at b4j.example.b4xmainpage._b4xpage_created(b4xmainpage.java:90)
at b4j.example.b4xmainpage.callSub(b4xmainpage.java:1315)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:498)
... 23 more