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?

Community
  • 1
  • 1
Stahlkocher
  • 183
  • 3
  • 10

1 Answers1

-1

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

Enjoy :)

Community
  • 1
  • 1
mitesh patel
  • 73
  • 2
  • 8