[CB-367] Back button event should fire on key up not key down

Also changed menu key and search key to be consistent.
This commit is contained in:
Bryce Curtis 2012-03-23 15:17:09 -05:00
parent a688319ea7
commit 9d26598334

View File

@ -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