From 9b3ef6da01a00f83f9f86a8e0b5d332eeff44c44 Mon Sep 17 00:00:00 2001 From: Gao Chun Date: Fri, 19 Sep 2014 11:06:28 +0800 Subject: [PATCH] Fix issue that app crashs when exit with back key. Adjust the onDestory() invoking in CordovaActivity.java to avoid the null object reference. BUG=https://crosswalk-project.org/jira/browse/XWALK-2493 --- framework/src/org/apache/cordova/CordovaActivity.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java index c9b830c0..3d9bb5eb 100755 --- a/framework/src/org/apache/cordova/CordovaActivity.java +++ b/framework/src/org/apache/cordova/CordovaActivity.java @@ -784,9 +784,6 @@ protected void onResume() { */ public void onDestroy() { LOG.d(TAG, "CordovaActivity.onDestroy()"); - super.onDestroy(); - if (this.appView != null) - this.appView.onDestroy(); // hide the splash screen to avoid leaking a window this.removeSplashScreen(); @@ -797,6 +794,8 @@ public void onDestroy() { else { this.activityState = ACTIVITY_EXITING; } + + super.onDestroy(); } /**