mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
CB-952: Android showSplashScreen crashes
This commit is contained in:
parent
0180342dff
commit
beb9460538
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@
|
|||||||
default.properties
|
default.properties
|
||||||
gen
|
gen
|
||||||
assets/www/cordova.js
|
assets/www/cordova.js
|
||||||
|
framework/assets/www/.tmp*
|
||||||
local.properties
|
local.properties
|
||||||
framework/proguard.cfg
|
framework/proguard.cfg
|
||||||
framework/cordova.jar
|
framework/cordova.jar
|
||||||
|
@ -619,10 +619,12 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
// If app doesn't want to run in background
|
// If app doesn't want to run in background
|
||||||
if (!this.keepRunning) {
|
if (!this.keepRunning) {
|
||||||
|
|
||||||
// Pause JavaScript timers (including setInterval)
|
// Pause JavaScript timers (including setInterval)
|
||||||
this.appView.pauseTimers();
|
this.appView.pauseTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hide the splash screen to avoid leaking a window
|
||||||
|
this.removeSplashScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -684,6 +686,9 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
LOG.d(TAG, "onDestroy()");
|
LOG.d(TAG, "onDestroy()");
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
|
||||||
|
// hide the splash screen to avoid leaking a window
|
||||||
|
this.removeSplashScreen();
|
||||||
|
|
||||||
if (this.appView != null) {
|
if (this.appView != null) {
|
||||||
|
|
||||||
// Send destroy event to JavaScript
|
// Send destroy event to JavaScript
|
||||||
@ -966,7 +971,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
* Removes the Dialog that displays the splash screen
|
* Removes the Dialog that displays the splash screen
|
||||||
*/
|
*/
|
||||||
public void removeSplashScreen() {
|
public void removeSplashScreen() {
|
||||||
if (splashDialog != null) {
|
if (splashDialog != null && splashDialog.isShowing()) {
|
||||||
splashDialog.dismiss();
|
splashDialog.dismiss();
|
||||||
splashDialog = null;
|
splashDialog = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user