Android: Fix pause menu getting stuck open on some settings
This commit is contained in:
parent
8ace5ff6b8
commit
8239d464b9
|
@ -55,6 +55,7 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
||||||
private String mGameTitle = null;
|
private String mGameTitle = null;
|
||||||
private String mGameCoverPath = null;
|
private String mGameCoverPath = null;
|
||||||
private EmulationSurfaceView mContentView;
|
private EmulationSurfaceView mContentView;
|
||||||
|
private MenuDialogFragment mPauseMenu;
|
||||||
|
|
||||||
private boolean getBooleanSetting(String key, boolean defaultValue) {
|
private boolean getBooleanSetting(String key, boolean defaultValue) {
|
||||||
return mPreferences.getBoolean(key, defaultValue);
|
return mPreferences.getBoolean(key, defaultValue);
|
||||||
|
@ -257,6 +258,9 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
||||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||||
Log.i("EmulationActivity", "Surface destroyed");
|
Log.i("EmulationActivity", "Surface destroyed");
|
||||||
|
|
||||||
|
if (mPauseMenu != null)
|
||||||
|
mPauseMenu.close(false);
|
||||||
|
|
||||||
// Save the resume state in case we never get back again...
|
// Save the resume state in case we never get back again...
|
||||||
if (AndroidHostInterface.getInstance().isEmulationThreadRunning() && !mStopRequested)
|
if (AndroidHostInterface.getInstance().isEmulationThreadRunning() && !mStopRequested)
|
||||||
AndroidHostInterface.getInstance().saveResumeState(true);
|
AndroidHostInterface.getInstance().saveResumeState(true);
|
||||||
|
@ -452,8 +456,11 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
||||||
AndroidHostInterface.getInstance().pauseEmulationThread(true);
|
AndroidHostInterface.getInstance().pauseEmulationThread(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
final MenuDialogFragment fragment = new MenuDialogFragment(this);
|
if (mPauseMenu != null)
|
||||||
fragment.show(getSupportFragmentManager(), "MenuDialogFragment");
|
mPauseMenu.close(false);
|
||||||
|
|
||||||
|
mPauseMenu = new MenuDialogFragment(this);
|
||||||
|
mPauseMenu.show(getSupportFragmentManager(), "MenuDialogFragment");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showSaveStateMenu(boolean saving) {
|
private void showSaveStateMenu(boolean saving) {
|
||||||
|
@ -842,9 +849,11 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
||||||
|
|
||||||
if (resumeGame)
|
if (resumeGame)
|
||||||
emulationActivity.onMenuClosed();
|
emulationActivity.onMenuClosed();
|
||||||
|
|
||||||
|
emulationActivity.mPauseMenu = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void close(boolean resumeGame) {
|
public void close(boolean resumeGame) {
|
||||||
dismiss();
|
dismiss();
|
||||||
onClosed(resumeGame);
|
onClosed(resumeGame);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue