You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2012/07/11 02:54:20 UTC

[1/2] android commit: CB-952: Android showSplashScreen crashes

Updated Branches:
  refs/heads/master b97748d3d -> beb946053


CB-952: Android showSplashScreen crashes


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/beb94605
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/beb94605
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/beb94605

Branch: refs/heads/master
Commit: beb9460538a9075a49f487f79d1cd66be0e87773
Parents: 0180342
Author: macdonst <si...@gmail.com>
Authored: Tue Jul 10 20:50:28 2012 -0400
Committer: macdonst <si...@gmail.com>
Committed: Tue Jul 10 20:52:07 2012 -0400

----------------------------------------------------------------------
 .gitignore                                     |    1 +
 framework/src/org/apache/cordova/DroidGap.java |    9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/beb94605/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 85278e2..cf5f6ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 default.properties
 gen
 assets/www/cordova.js
+framework/assets/www/.tmp*
 local.properties
 framework/proguard.cfg
 framework/cordova.jar

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/beb94605/framework/src/org/apache/cordova/DroidGap.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java
index 1a23f22..fe47df4 100755
--- a/framework/src/org/apache/cordova/DroidGap.java
+++ b/framework/src/org/apache/cordova/DroidGap.java
@@ -619,10 +619,12 @@ public class DroidGap extends Activity implements CordovaInterface {
 
         // If app doesn't want to run in background
         if (!this.keepRunning) {
-
             // Pause JavaScript timers (including setInterval)
             this.appView.pauseTimers();
         }
+
+        // hide the splash screen to avoid leaking a window
+        this.removeSplashScreen();
     }
 
     @Override
@@ -684,6 +686,9 @@ public class DroidGap extends Activity implements CordovaInterface {
         LOG.d(TAG, "onDestroy()");
         super.onDestroy();
 
+        // hide the splash screen to avoid leaking a window
+        this.removeSplashScreen();
+
         if (this.appView != null) {
 
             // Send destroy event to JavaScript
@@ -966,7 +971,7 @@ public class DroidGap extends Activity implements CordovaInterface {
      * Removes the Dialog that displays the splash screen
      */
     public void removeSplashScreen() {
-        if (splashDialog != null) {
+        if (splashDialog != null && splashDialog.isShowing()) {
             splashDialog.dismiss();
             splashDialog = null;
         }