Hide system bars

Does anyone know how to do this in Xojo, I want to hide the android system bars so that I can have a full-screen app, I’ve found the android page that (I think) shows the functions to do this:- Hide system bars for immersive mode  |  Views  |  Android Developers

I think I need to use a delegate or something to point to a library and then call these functions, but I’m new to android so I’m wondering if I’m on the right track ?

I’ll add the following Declare into the next version of the Android Design Extensions!

' Working for API 30+ (Android 11+)
If System.Version.BuildVersion.ToInteger >= 30 Then
  Declare Sub ShowFullscreen Lib "Object:Screen1:MobileScreen" Alias "getWindow()!!.getDecorView().getWindowInsetsController()!!.hide(androidx.core.view.WindowInsetsCompat.Type.systemBars())"
  ShowFullscreen
End if
1 Like

Hi Martin, thanks for helping, I started a new android project and put a button on screen1 and then put your code in the button pressed handler, when I run it and press the button the app closes without error or message and Xojo stops debugging, maybe i put the declare in the wrong place ?

Which Xojo Version do you use? Works fine at my place using Xojo 2024r1.

Yep thats what im using 2024r1, emulated 10" tablet android 8

The Declare is working with Android API 30+. Working here on Pixel 3, Android 14 (API 34).

Maybe it doesn’t work on android 8 then.