diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index b1dfa9f221..1e5065c563 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -384,6 +384,9 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh Log.v(TAG, "onCreate()"); super.onCreate(savedInstanceState); + if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */) { + getWindow().setDecorFitsSystemWindows(false); + } /* Control activity re-creation */ if (mSDLMainFinished || mActivityCreated) { @@ -1037,7 +1040,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh // Android 15+ (API 35+), where edge-to-edge is enforced for // apps targeting that SDK, so the status/navigation bars // would never hide. Use WindowInsetsController instead. - window.setDecorFitsSystemWindows(false); final WindowInsetsController controller = window.getInsetsController(); if (controller != null) { controller.hide(WindowInsets.Type.systemBars()); @@ -1080,10 +1082,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */) { window.getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; } - if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */ && - Build.VERSION.SDK_INT < 35 /* Android 15 */) { - SDLActivity.onNativeInsetsChanged(0, 0, 0, 0); - } } } else { Log.e(TAG, "error handling message, getContext() returned no Activity");