Avoid NPE on showing splash screen

This commit is contained in:
Aaron Culliney 2015-09-15 22:41:33 -07:00
parent 5692c1dc95
commit 8d3de3ddd0

View File

@ -245,6 +245,7 @@ public class Apple2Activity extends Activity {
// Apparently not good to leave popup/dialog windows showing when backgrounding.
// Dismiss these popups to avoid android.view.WindowLeaked issues
synchronized (this) {
dismissAllMenus();
mSplashScreen = null;
@ -252,6 +253,7 @@ public class Apple2Activity extends Activity {
nativeOnPause(true);
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
@ -455,8 +457,12 @@ public class Apple2Activity extends Activity {
runOnUiThread(new Runnable() {
@Override
public void run() {
synchronized (Apple2Activity.this) {
if (mSplashScreen != null) {
mSplashScreen.show();
}
}
}
});
}