Solution Soft Keyboard Not Shown in WebView

Pernah mengalami membuat WebView yang terdapat edit text nya namun tidak muncul soft keyboardnya ketika ingin memberi inputan?


ada solusi bagus nih..
"Menambahkan kode berikut ini untuk melengkapi properti WebView"

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;
        }
    });

refrensi : http://stackoverflow.com/questions/4200259/tapping-form-field-in-webview-does-not-show-soft-keyboard

Post a Comment

Lebih baru Lebih lama