forked from github/cordova-android
[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:
parent
a688319ea7
commit
9d26598334
@ -1078,9 +1078,9 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
* @param event
|
* @param event
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||||
if (this.appView == null) {
|
if (this.appView == null) {
|
||||||
return super.onKeyDown(keyCode, event);
|
return super.onKeyUp(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If back key
|
// If back key
|
||||||
@ -1103,7 +1103,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
// If not, then invoke behavior of super class
|
// If not, then invoke behavior of super class
|
||||||
else {
|
else {
|
||||||
this.activityState = ACTIVITY_EXITING;
|
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
|
// If menu key
|
||||||
else if (keyCode == KeyEvent.KEYCODE_MENU) {
|
else if (keyCode == KeyEvent.KEYCODE_MENU) {
|
||||||
this.appView.loadUrl("javascript:cordova.fireDocumentEvent('menubutton');");
|
this.appView.loadUrl("javascript:cordova.fireDocumentEvent('menubutton');");
|
||||||
return super.onKeyDown(keyCode, event);
|
return super.onKeyUp(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If search key
|
// If search key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user