diff --git a/framework/assets/www/cordova.js b/framework/assets/www/cordova.js index 9d9f78e3..c86b71d4 100644 --- a/framework/assets/www/cordova.js +++ b/framework/assets/www/cordova.js @@ -1,5 +1,5 @@ // Platform: android -// 3b066a6856fd4d01806a332f2ab57eb7d340fe35 +// 24ab6855470f2dc0662624b597c98585e56a1666 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -284,10 +284,16 @@ var cordova = { if (callback) { if (isSuccess && status == cordova.callbackStatus.OK) { callback.success && callback.success.apply(null, args); - } else { + } else if (!isSuccess) { callback.fail && callback.fail.apply(null, args); } - + /* + else + Note, this case is intentionally not caught. + this can happen if isSuccess is true, but callbackStatus is NO_RESULT + which is used to remove a callback from the list without calling the callbacks + typically keepCallback is false in this case + */ // Clear callback if not expecting any more results if (!keepCallback) { delete cordova.callbacks[callbackId]; @@ -631,7 +637,6 @@ var utils = require('cordova/utils'), * onDeviceReady* User event fired to indicate that Cordova is ready * onResume User event fired to indicate a start/resume lifecycle event * onPause User event fired to indicate a pause lifecycle event - * onDestroy* Internal event fired when app is being destroyed (User should use window.onunload event, not this one). * * The events marked with an * are sticky. Once they have fired, they will stay in the fired state. * All listeners that subscribe after the event is fired will be executed right away. @@ -843,9 +848,6 @@ channel.create('onResume'); // Event to indicate a pause lifecycle event channel.create('onPause'); -// Event to indicate a destroy lifecycle event -channel.createSticky('onDestroy'); - // Channels that must fire before "deviceready" is fired. channel.waitForInitialization('onCordovaReady'); channel.waitForInitialization('onDOMContentLoaded'); diff --git a/framework/src/org/apache/cordova/AndroidWebView.java b/framework/src/org/apache/cordova/AndroidWebView.java index 4be632a3..109ad818 100755 --- a/framework/src/org/apache/cordova/AndroidWebView.java +++ b/framework/src/org/apache/cordova/AndroidWebView.java @@ -630,9 +630,6 @@ public class AndroidWebView extends WebView implements CordovaWebView { // Cancel pending timeout timer. loadUrlTimeout++; - // Send destroy event to JavaScript - this.loadUrl("javascript:try{cordova.require('cordova/channel').onDestroy.fire();}catch(e){console.log('exception firing destroy event from native');};"); - // Load blank page so that JavaScript onunload is called this.loadUrl("about:blank");