Home » Android » Android 4.4.2 & soft keyboard. optionmenu is possible? "Unimplemented WebView method onKeyDown called from" is occurred

Android 4.4.2 & soft keyboard. optionmenu is possible? "Unimplemented WebView method onKeyDown called from" is occurred

Posted by: admin May 14, 2020 Leave a comment

Questions:

someone posted this….

In 4.4.2 (api level 19) a WebView no longer recieves keypress event in javascript correctly when the soft (software) keyboard is used. The javascript function is not called.
I have confirmed this both in the emulator and on the Nexus 4 running 4.4.2. I’ve attached a sample web page.
For the emulator, LogCat displays these messages indicating problems:

04-07 23:59:22.613: E/chromium(2271): [ERROR:immediate_input_router.cc(507)] We seem to have a different key type sent from the renderer. (7 vs. 10). Ignoring event.
04-07 23:59:22.613: E/chromium(2271): [ERROR:immediate_input_router.cc(504)] Got a KeyEvent back from the renderer but we don't seem to have sent it to the renderer!
04-07 23:59:22.633: E/chromium(2271): [ERROR:immediate_input_router.cc(504)] Got a KeyEvent back from the renderer but we don't seem to have sent it to the renderer!
04-07 23:59:54.203: W/UnimplementedWebViewApi(2271): Unimplemented WebView method onKeyDown called from: android.webkit.WebView.onKeyDown(WebView.java:2169)

So, is there no way to see optionmenu in Android 4.4.2 & soft keyboard?
when I touch the soft keyboard menu button,
logcat displays

08-08 17:25:55.138: W/UnimplementedWebViewApi(22840): Unimplemented WebView method onKeyDown called from: android.webkit.WebView.onKeyDown(WebView.java:2169)
How to&Answers:

What I suggest here is :

You can attach a webview client to webview. Then you can overide a method in the class which extends BaseInputConnection:

@Override
public boolean sendKeyEvent(KeyEvent event) {
    return super.sendKeyEvent(event);
    // call webview client method here to let javascript know what key was pressed
}

I hope this may help you.