webView.addJavascriptInterface(object, name);
这句话在android4.2版本以上会报错,提示None of the methods in the added interface have been annotated with @android.webkit.JavascriptInterface; they will not be visible in API 17.如下图所示:
解决办法:在js要调用的java本地方法上面加上 @JavascriptInterface 如下图: