Updated Branches: refs/heads/master 9d0c5349b -> 331024414
Fixed the backbutton issues with the keyboard without causing issues with the menu button so far Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/33102441 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/33102441 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/33102441 Branch: refs/heads/master Commit: 331024414ef46665eb9fab08ab7862cc1c9a8e3d Parents: 9d0c534 Author: Joe Bowser <bows...@apache.org> Authored: Wed Sep 5 16:10:48 2012 -0700 Committer: Joe Bowser <bows...@apache.org> Committed: Wed Sep 5 16:10:48 2012 -0700 ---------------------------------------------------------------------- framework/src/org/apache/cordova/DroidGap.java | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/33102441/framework/src/org/apache/cordova/DroidGap.java ---------------------------------------------------------------------- diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java index 935f0b1..2b70e8a 100755 --- a/framework/src/org/apache/cordova/DroidGap.java +++ b/framework/src/org/apache/cordova/DroidGap.java @@ -47,6 +47,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; +import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.LinearLayout; @@ -995,6 +996,20 @@ public class DroidGap extends Activity implements CordovaInterface { this.runOnUiThread(runnable); } + + @Override + public boolean onKeyUp(int keyCode, KeyEvent event) + { + //Determine if the focus is on the current view or not + if(appView.getHitTestResult().getType() == WebView.HitTestResult.EDIT_TEXT_TYPE && + keyCode == KeyEvent.KEYCODE_BACK) + { + return appView.onKeyUp(keyCode, event); + } + else + return super.onKeyUp(keyCode, event); + } + /** * Called when a message is sent to plugin. *