想必熟悉android开发的同学都知道使用原生webview与js的交互方式,下面我们先来回顾一下。一、原生Androidwebview与js的交互方式webview通过addJavascriptInterface进行对象映射首先要打开交互权限,允许使用javascriptwebSettings.setJavaScriptEnabled(true);第一步,进行对象映射,如下所示:webView.addJavascriptInterface(newJsInterface(),"android");说明:以上“JsInterface”、“android”都可以自己命名,这里仅做为示例。第二步,定