Can we hide the Android system keyboard when the user focuses or clicks on the html input elements inside the web view.
I tried hiding the keyboard on a webview user touch:
webView.setOnTouchListener(new View.OnTouchListener()
{
@Override
public boolean onTouch (View v, MotionEvent event){
Toast.makeText(cx,"Web View Touch",Toast.LENGTH_LONG).show();
v.onTouchEvent(event);
InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null) {
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
return true;
}
})
But that does not work.
Is it possible to completely hide the keyboard for the application?
source
share