Android Question [B4XPages] Trying to make SPlash Screen Work in Immersive mode

Dev-i9

Member
Hi Guys and Gals,

I am trying to make a B4XPages project immersive.
This wouldn't be a difficult ask if it wasn't for the fact that I also use The Splash approach...
The splash code at some point terminates the current (Main) Activity, just after creating and calling a new one that will be the base for the B4XPages.
But for the immersive mode to work, it has to Activity_WindowFocusChanged in order to change a few flags and set the immersiveness.
My issue emerges when, after the Splash is done, and the activity is killed, it still calls Activity_WindowFocusChanged wich, due to the fact that it no longer exists, errors out with a NullPointerException.

In my (not so) logic mind, since activity no longer exists, it should not call Activity_WindowFocusChanged ( we previously kill it)
So, why this happens and how can I prevent this error?

Error occurred on line: 72 (Main)
java.lang.NullPointerException: Attempt to read from field 'anywheresoftware.b4a.BA b4a.example.main.activityBA' on a null object reference
at b4a.example.main._activity_windowfocuschanged(main.java:500)
......
 
Top