-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android status/system bars randomly won't hide when resuming the app #8995
Comments
@leonstyhre public void onSystemUiVisibilityChange(int visibility) seems to be user to hide the system bar.. ( or maybe we should add a call: |
Thanks for taking a look at this! I tried adding the following to SDLActivity::onResume() while also commenting out my overloaded onSystemUiVisibilityChange() method:
While this improves things it's not perfect. The result is a bit glitchy as the system bars will be displayed when resuming the app, then disappear, then appear immediately again and disappear once more. So it happens twice for some reason. With the code mention in my first post it's much more seamless, the system bars are just faded out when resuming the app, which is the behavior you would expect. |
I have also encountered this issue. It happens very consistently in portait mode for an app that uses landscape mode per default. When holding the phone in landscape mode the entire time, the bug does not seem to happen on my phone. Not directly related to this bug, but I noticed that a wrong constant seems to be used as a system UI visibility flag: SDL/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java Lines 904 to 910 in 4b3b5fb
SDL/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java Lines 1738 to 1745 in 4b3b5fb
The flag |
Hi!
There is an issue on Android where the system bars sometimes won't get hidden when focusing/resuming the app window. It happens randomly although much more frequently when the screen has to be rotated.
For example my application always runs in landscape mode, so if I have the home screen set to portrait mode and then switch between this and my application then the system bars won't get hidden around every third or fourth time. They will stay indefinitely and the only way to get rid of them is to go back to the home screen and then back to the app again.
Adding the following to SDLActivity::onSystemUiVisibilityChange() seems to completely resolve the issue but I'm pretty sure this is not a proper fix (and I think it only works on Android 11 and later):
Based on the behavior I observe when the screen rotation takes place I suspect that this could be some kind of race condition where you are hiding the system bars before the screen rotation has been completed. However the issue can also occur when rotation does not take place, i.e. when the home screen is also set to landscape mode. But that is much less frequent and may happen only once every 10 or 15 tries.
The text was updated successfully, but these errors were encountered: