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();
}
public void show() {
public synchronized void show() {
if (isShowing()) {
return;
}

View File

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

View File

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