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/11/27 18:19:00 UTC
android commit: CB-1938: Regression,
Android back button event is no longer fired
Updated Branches:
refs/heads/master 7b3724972 -> 48f58110f
CB-1938: Regression, Android back button event is no longer fired
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/48f58110
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/48f58110
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/48f58110
Branch: refs/heads/master
Commit: 48f58110fec31a6cf8dd4e39962682d21513adaa
Parents: 7b37249
Author: Simon MacDonald <si...@gmail.com>
Authored: Tue Nov 27 12:18:49 2012 -0500
Committer: Simon MacDonald <si...@gmail.com>
Committed: Tue Nov 27 12:18:49 2012 -0500
----------------------------------------------------------------------
framework/src/org/apache/cordova/App.java | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/48f58110/framework/src/org/apache/cordova/App.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/App.java b/framework/src/org/apache/cordova/App.java
index 5433d31..dad34a0 100755
--- a/framework/src/org/apache/cordova/App.java
+++ b/framework/src/org/apache/cordova/App.java
@@ -19,13 +19,14 @@
package org.apache.cordova;
+import org.apache.cordova.api.CallbackContext;
import org.apache.cordova.api.CordovaPlugin;
import org.apache.cordova.api.LOG;
-import org.apache.cordova.api.Plugin;
import org.apache.cordova.api.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
+
import java.util.HashMap;
/**
@@ -36,12 +37,12 @@ public class App extends CordovaPlugin {
/**
* Executes the request and returns PluginResult.
*
- * @param action The action to execute.
- * @param args JSONArry of arguments for the plugin.
- * @param callbackId The callback id used when calling back into JavaScript.
- * @return A PluginResult object with a status and message.
+ * @param action The action to execute.
+ * @param args JSONArry of arguments for the plugin.
+ * @param callbackContext The callback context from which we were invoked.
+ * @return A PluginResult object with a status and message.
*/
- public PluginResult execute(String action, JSONArray args, String callbackId) {
+ public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
PluginResult.Status status = PluginResult.Status.OK;
String result = "";
@@ -80,9 +81,11 @@ public class App extends CordovaPlugin {
else if (action.equals("exitApp")) {
this.exitApp();
}
- return new PluginResult(status, result);
+ callbackContext.sendPluginResult(new PluginResult(status, result));
+ return true;
} catch (JSONException e) {
- return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
+ callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
+ return false;
}
}