1、添加方法
mWebView.addJavascriptInterface(new JsInterface(), "android");
2:android中的写法,下面这段很重要
String path = "http://test123.html"; String method = "javascript:displayImg('" + path + "')"; mWebView.loadUrl(method);
3、h5中的方法:
//点击上传
function displayImg(url){
//这时H5调用displayImg方法就可以获取到这个url
}