webView.addJavascriptInterface(obj,"myobj");//前面对象,后面js中的调用名
If you've set your targetSdkVersion
to 17 or higher, you must add the @JavascriptInterface
在一切需要在JS中调用的对象方法前加上@JavascriptInterface, 在api 17 即 android 4.2.2 之后
webView.addJavascriptInterface(obj,"myobj");//前面对象,后面js中的调用名
If you've set your targetSdkVersion
to 17 or higher, you must add the @JavascriptInterface
在一切需要在JS中调用的对象方法前加上@JavascriptInterface, 在api 17 即 android 4.2.2 之后