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() {
@Override
public void run() {
synchronized (Apple2Activity.this) {
if (mSplashScreen == null) {
mSplashScreen = new Apple2SplashScreen(Apple2Activity.this);
}
if (mSplashScreen.isShowing()) {
return;
}
mSplashScreen.show();
Apple2CrashHandler.getInstance().checkForCrashes(Apple2Activity.this);
}
mSplashScreen.show();
Apple2CrashHandler.getInstance().checkForCrashes(Apple2Activity.this);
}
});
}
@ -589,6 +585,9 @@ public class Apple2Activity extends Activity {
if (menuView.isShown()) {
((ViewGroup) menuView.getParent()).removeView(menuView);
}
if (apple2MenuView == mSplashScreen) {
mSplashScreen = null;
}
}
// if no more views on menu stack, resume emulation