Android Question ImmersiveMode Using B4A

Big Dave

Member
Licensed User
Longtime User
I have been trying to use the Immersive mode...https://www.b4x.com/android/forum/threads/immersive-mode-hide-system-bars.161680/ but still have a missing library issue.

For context I have copied an app to a new more up to date device, the app originally written using B4A, not B4XPages. I have tried to follow the example in the thread above but still have a missing library issue on the "Dim immersive As ImmersiveMode" line. I have copied the jar and xml files to my Add Library folder but it is not showing in the Library list. Also I have no idea what to do with the B4X Mainfest (App Compatibility) code detailed in the thread.

All pointers and help very much appreciated.
 

Big Dave

Member
Licensed User
Longtime User
did you refresh the list?
Didn't realise you had to do that. Closed the project and B4A and then reopened and ImmersiveMode is now in the list. TYVM for that.

Can you enlighten me as to the purpose of the B4X Manifest (app compatibility), do I need to include it as the app is B4A not B4XPages.
 
Upvote 0

Big Dave

Member
Licensed User
Longtime User
App is now failing on..
B4X:
Sub Activity_WindowFocusChanged(HasFocus As Boolean)

    If HasFocus Then
        imImmersive.SetMode(imImmersive.SYSTEM_UI_FLAG_FULLSCREEN)
    End If
   
End Sub

With a null pointer error on the "Sub Activity..." line

java.lang.NullPointerException: Attempt to read from field 'anywheresoftware.b4a.BA b4a.konnqa3.main.activityBA' on a null object reference in method 'java.lang.String b4a.konnqa3.main._activity_windowfocuschanged(boolean)'

I suspect I am missing something?

Thanks in advance.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…