Android: loading JavaScript using WebView.loadUrl but keeping the soft keyboard

When a user clicks on (html) Textfield in a WebView , a soft keyboard is displayed. But when I load JS using WebView.loadUrl() , the soft keyboard disappears.

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

Is there any other way to load JS?

I also tried to process the keyboard manually. But there are too many disadvantages. It is difficult to determine if the keyboard is shown. And I would have to change my layout: How to check the visibility of the soft keyboard in Android?
And the keyboard will no longer be running WebView .

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

+7
source share
1 answer

After loading, javascript will again focus on the text field. This will solve the problem. This will be useful for discussing the focus.

Enjoy :)

-one
source

All Articles