android: update of display cutouts after activity pause
This commit is contained in:
parent
46ca618b67
commit
117f450574
1 changed files with 7 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue