I find out that the code below will only work for hardware buttons
webView.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if(!v.hasFocus()){
v.requestFocus();
}
return false;
}
});
onKey() method not getting called.