你可以通过js接口在webview 中写类似如下代码
mWvMain.addJavascriptInterface(new WebTOANDROIDInterface(), "stub");
public class WebTOANDROIDInterface{
@JavascriptInterface
public void jsMethod(String paramFromJS) {
if ("1".equals(paramFromJS)) {
Intent intent =new Intent(WebviewActivity.this, ShareActivity.class);
intent.putExtra("content", paramFromJS);
startActivity(intent);
//sendReq(false, paramFromJS);
//ShareActivity.shareActivity.sendReq(false, paramFromJS);
} else if ("2".equals(paramFromJS)) {
Intent intent =new Intent(WebviewActivity.this, FamilyNetworkActivity.class);
startActivity(intent);
}
然后在h5页面中填写windows.stub.jsMethod(//传值)就可以了。网上有很多类似的可以查看一下