android: update of display cutouts after activity pause

This commit is contained in:
ardocrat 2023-06-14 16:25:39 +03:00
parent 46ca618b67
commit 117f450574

View file

@ -53,7 +53,6 @@ public class MainActivity extends GameActivity {
if (orientationEventListener.canDetectOrientation()) {
orientationEventListener.enable();
}
onDisplayCutoutsChanged(Utils.getDisplayCutouts(this));
// Register receiver to finish activity from the BackgroundService.
registerReceiver(mBroadcastReceiver, new IntentFilter(FINISH_ACTIVITY_ACTION));
@ -64,6 +63,13 @@ public class MainActivity extends GameActivity {
native void onDisplayCutoutsChanged(int[] cutouts);
@Override
protected void onResume() {
super.onResume();
// Update display cutouts.
onDisplayCutoutsChanged(Utils.getDisplayCutouts(this));
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {