diff --git a/framework/src/org/apache/cordova/AndroidCordovaWebView.java b/framework/src/org/apache/cordova/AndroidCordovaWebView.java index ba117375..f813860b 100755 --- a/framework/src/org/apache/cordova/AndroidCordovaWebView.java +++ b/framework/src/org/apache/cordova/AndroidCordovaWebView.java @@ -19,7 +19,6 @@ package org.apache.cordova; -import java.util.ArrayList; import java.util.HashMap; import java.util.Locale; @@ -60,9 +59,6 @@ public class AndroidCordovaWebView extends CordovaWebView { public static final String TAG = "CordovaWebView"; public static final String CORDOVA_VERSION = "3.6.0-dev"; - private ArrayList keyDownCodes = new ArrayList(); - private ArrayList keyUpCodes = new ArrayList(); - private boolean paused; private BroadcastReceiver receiver; @@ -550,24 +546,13 @@ public class AndroidCordovaWebView extends CordovaWebView { @Override public void bindButton(String button, boolean override) { if (button.compareTo("volumeup")==0) { - keyDownCodes.add(KeyEvent.KEYCODE_VOLUME_UP); + webview.bindButton(KeyEvent.KEYCODE_VOLUME_UP, true); } else if (button.compareTo("volumedown")==0) { - keyDownCodes.add(KeyEvent.KEYCODE_VOLUME_DOWN); + webview.bindButton(KeyEvent.KEYCODE_VOLUME_DOWN, true); } } - private void bindButton(int keyCode, boolean keyDown, boolean override) { - if(keyDown) - { - keyDownCodes.add(keyCode); - } - else - { - keyUpCodes.add(keyCode); - } - } - @Override public boolean isBackButtonBound() { diff --git a/framework/src/org/apache/cordova/AndroidWebView.java b/framework/src/org/apache/cordova/AndroidWebView.java index 1d34cbfe..786475c2 100644 --- a/framework/src/org/apache/cordova/AndroidWebView.java +++ b/framework/src/org/apache/cordova/AndroidWebView.java @@ -337,6 +337,20 @@ public class AndroidWebView extends WebView { return false; } + /* + * Add a key code to either the keyUp or keyDown handler lists. + */ + void bindButton(int keyCode, boolean keyDown) { + if(keyDown) + { + keyDownCodes.add(keyCode); + } + else + { + keyUpCodes.add(keyCode); + } + } + /* * onKeyDown */