7

When a user click on a (html) Textfield in a WebView, the soft keyboard is shown. But when I load some JS with WebView.loadUrl() the soft keyboard disappears.

I understand the behaviour when you load a new page. But how can I change the behaviour of the WebView when loading JS?

Is there another way to load JS?

I also tried to handle the keyboard manually. But there are too many drawbacks. It is complicated to determine if the keyboard is shown. And I would have to change my layout: How to check visibility of software keyboard in Android?
And the keyboard would not be in the control of the WebView anymore.

Q: How to load JS into a WebView, without affecting the soft keyboard?

1 Answer 1

-1

After loading javascript give focus to textfield again. That will solve problem. For giving focus this discussion will be helpful.

Enjoy :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.