From 451688a12e1eb43303601be357d9c40fd4cf1ce5 Mon Sep 17 00:00:00 2001 From: Simon MacDonald Date: Tue, 18 Sep 2012 11:49:11 -0400 Subject: [PATCH] CB-1126: Splashscreen --- bin/templates/project/AndroidManifest.xml | 1 + framework/src/org/apache/cordova/DroidGap.java | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/templates/project/AndroidManifest.xml b/bin/templates/project/AndroidManifest.xml index a2430899..090c41eb 100644 --- a/bin/templates/project/AndroidManifest.xml +++ b/bin/templates/project/AndroidManifest.xml @@ -50,6 +50,7 @@ android:hardwareAccelerated="true" android:debuggable="true"> diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java index 9827ed53..0fe5b8ab 100755 --- a/framework/src/org/apache/cordova/DroidGap.java +++ b/framework/src/org/apache/cordova/DroidGap.java @@ -406,6 +406,8 @@ public class DroidGap extends Activity implements CordovaInterface { } this.splashscreenTime = time; + this.splashscreen = this.getIntegerProperty("splashscreen", 0); + this.showSplashScreen(this.splashscreenTime); this.appView.loadUrl(url, time); } @@ -996,7 +998,6 @@ public class DroidGap extends Activity implements CordovaInterface { this.runOnUiThread(runnable); } - @Override public boolean onKeyUp(int keyCode, KeyEvent event) { @@ -1024,8 +1025,11 @@ public class DroidGap extends Activity implements CordovaInterface { this.removeSplashScreen(); } else { - this.splashscreen = this.getIntegerProperty("splashscreen", 0); - this.showSplashScreen(this.splashscreenTime); + // If the splash dialog is showing don't try to show it again + if (this.splashDialog != null && !this.splashDialog.isShowing()) { + this.splashscreen = this.getIntegerProperty("splashscreen", 0); + this.showSplashScreen(this.splashscreenTime); + } } } else if ("spinner".equals(id)) {