Android navigation bar reappears after sleep

I am using OpenFL 3.6.1 and HaxeFlixel 4.2.1

When I return to my game after the device has gone into sleep mode (from either auto-sleep due to inactivity, or from pressing the power button), Android’s navigation bar appears in the game, and does not go away. Interestingly, this does not happen if I exit the game and re-open it.

I want to use immersive mode and keep the game always fullscreen, but it seems that fullscreen is not maintained after sleep. Is there any way around this? Thanks in advance.

I don’t remember exactly how it was implemented before

In the current version, the code looks like this:

If our current code is not hiding the navigation properly, it may be due to not calling the updateSystemUI method at an important time

Thanks! The code I have is a bit different, but I noticed that it wasn’t hiding the UI on resume, so I just added hideSystemUi(); to doResume(), and that seems to have done the trick :slight_smile:

1 Like

I had a similar issue, but my fix is different than Vasco’s.

I found SDLActivity::onWindowFocusChanged(bool) being called, so I override the function in, and call updateSystemUI().

@Override public void onWindowFocusChanged(boolean hasFocus) {
		updateSystemUI ();
1 Like