1

First I use webview in my android app to load html, it not works well. Then I use xwalkview of crosswalk replaced webview, the page loads well. In my page I've a button with js code to call java function. But when I click the button, nothing changes except below error in the android studio.

js call java implemented as this

[ERROR:xwalk_autofill_client.cc(121)] Not implemented reached in virtual void xwalk::XWalkAutofillClient::OnFirstUserGestureObserved()

LF00
  • 27,015
  • 29
  • 156
  • 295

1 Answers1

2

After dig hours on this issue, I solve it.

It's caused by when I change XWalkView from webview, but forget to change the JavascriptInterface package. This will cause no build error or warnings.

When you import JavascriptInterface, take care, make sure you imported the exact one.

import org.xwalk.core.JavascriptInterface;

Not this one, this is for webview

import android.webkit.JavascriptInterface; 

For more refer this answer.

Community
  • 1
  • 1
LF00
  • 27,015
  • 29
  • 156
  • 295