0

In my application, there is a web view to load some pages. In some pages, android key board is not poping up when touched on text fields. For example, in facebook page, it is not possible to type username and password. Has anyone got any idea regarding this?

MithunRaj
  • 543
  • 2
  • 7
  • 19
  • possible duplicate: http://stackoverflow.com/questions/4200259/tapping-form-field-in-webview-does-not-show-soft-keyboard – JafarKhQ Jul 04 '13 at 08:43
  • Sorry, there is a mistake in the question. The issue is that, I can not type on the text fields. Any way key board comes up. – MithunRaj Jul 04 '13 at 09:12

1 Answers1

1

Try this :

webview.requestFocus(View.FOCUS_DOWN);
webview.setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
            case MotionEvent.ACTION_UP:
                if (!v.hasFocus()) {
                    v.requestFocus();
                }
                break;
        }
        return false;
    }
});

It works for me, thanks Tapping form field in WebView does not show soft keyboard

Community
  • 1
  • 1
Adrien Cerdan
  • 1,005
  • 1
  • 11
  • 21