Losing trust with implementation(s) of Apple2MenuView.isShowing()

- This changes the behavior to rely on non-null status as proxy for showing
    - TODO : investigate why isShowing() appears to be a race/bogus
This commit is contained in:
Aaron Culliney 2015-10-25 20:57:48 -07:00
parent 997461318f
commit 844d8b815b

View File

@ -492,20 +492,16 @@ public class Apple2Activity extends Activity {
}); });
} }
private void showSplashScreen() { private synchronized void showSplashScreen() {
if (mSplashScreen != null) {
return;
}
mSplashScreen = new Apple2SplashScreen(Apple2Activity.this);
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
synchronized (Apple2Activity.this) { mSplashScreen.show();
if (mSplashScreen == null) { Apple2CrashHandler.getInstance().checkForCrashes(Apple2Activity.this);
mSplashScreen = new Apple2SplashScreen(Apple2Activity.this);
}
if (mSplashScreen.isShowing()) {
return;
}
mSplashScreen.show();
Apple2CrashHandler.getInstance().checkForCrashes(Apple2Activity.this);
}
} }
}); });
} }
@ -589,6 +585,9 @@ public class Apple2Activity extends Activity {
if (menuView.isShown()) { if (menuView.isShown()) {
((ViewGroup) menuView.getParent()).removeView(menuView); ((ViewGroup) menuView.getParent()).removeView(menuView);
} }
if (apple2MenuView == mSplashScreen) {
mSplashScreen = null;
}
} }
// if no more views on menu stack, resume emulation // if no more views on menu stack, resume emulation