Fix synchronization for showing splash screen

This commit is contained in:
Aaron Culliney
2015-08-21 23:35:30 -07:00
parent 3f934ecd3f
commit 23bfd24054
3 changed files with 4 additions and 7 deletions

View File

@@ -41,7 +41,7 @@ public abstract class Apple2AbstractMenu implements Apple2MenuView {
setup(); setup();
} }
public void show() { public synchronized void show() {
if (isShowing()) { if (isShowing()) {
return; return;
} }

View File

@@ -424,15 +424,12 @@ public class Apple2Activity extends Activity {
} }
public synchronized void showSplashScreen() { public synchronized void showSplashScreen() {
if (mSplashScreen != null && mSplashScreen.isShowing()) { if (mSplashScreen == null) {
return; mSplashScreen = new Apple2SplashScreen(Apple2Activity.this);
} }
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
if (mSplashScreen == null) {
mSplashScreen = new Apple2SplashScreen(Apple2Activity.this);
}
mSplashScreen.show(); mSplashScreen.show();
} }
}); });

View File

@@ -61,7 +61,7 @@ public class Apple2SplashScreen implements Apple2MenuView {
/* ... */ /* ... */
} }
public void show() { public synchronized void show() {
if (isShowing()) { if (isShowing()) {
return; return;
} }