From 9d265983346942d1af2b7c307e9dc5ff344c3ee8 Mon Sep 17 00:00:00 2001 From: Bryce Curtis Date: Fri, 23 Mar 2012 15:17:09 -0500 Subject: [PATCH] [CB-367] Back button event should fire on key up not key down Also changed menu key and search key to be consistent. --- framework/src/org/apache/cordova/DroidGap.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java index 4d1ae72e..c48bf509 100755 --- a/framework/src/org/apache/cordova/DroidGap.java +++ b/framework/src/org/apache/cordova/DroidGap.java @@ -1078,9 +1078,9 @@ public class DroidGap extends Activity implements CordovaInterface { * @param event */ @Override - public boolean onKeyDown(int keyCode, KeyEvent event) { + public boolean onKeyUp(int keyCode, KeyEvent event) { if (this.appView == null) { - return super.onKeyDown(keyCode, event); + return super.onKeyUp(keyCode, event); } // If back key @@ -1103,7 +1103,7 @@ public class DroidGap extends Activity implements CordovaInterface { // If not, then invoke behavior of super class else { this.activityState = ACTIVITY_EXITING; - return super.onKeyDown(keyCode, event); + return super.onKeyUp(keyCode, event); } } } @@ -1111,7 +1111,7 @@ public class DroidGap extends Activity implements CordovaInterface { // If menu key else if (keyCode == KeyEvent.KEYCODE_MENU) { this.appView.loadUrl("javascript:cordova.fireDocumentEvent('menubutton');"); - return super.onKeyDown(keyCode, event); + return super.onKeyUp(keyCode, event); } // If search key