获取具有更改的控件状态的webview html字符串

时间:2017-06-09 21:39:26

标签: android android-webview

我在Android应用程序中工作,我想在webview中加载一组单选按钮,在那里我得到Html字符串。我已通过loadData()方法将html字符串成功加载到webview中。我还通过添加addJavascriptInterface来触发单选按钮的单击事件。

毕竟这些当我点击一个按钮时我想在webview中加载完整的html字符串,我希望html字符串中的单选按钮当前状态(选中或取消选中)当前没有得到

如何获取具有单选按钮状态更改的html字符串。

Html字符串:

<html>
<head>
<meta name = "viewport" content = "width=device-width; initial-scale=1.0, maximum-scale=1.0, user-scalable=no;"/>
</head>
<body>
<form>
What color do you prefer?<br />
<input type="radio" name="colors" id="red" />Red<br />
<input type="radio" name="colors" id="blue" />Blue<br />
<input type="radio" name="colors" id="green" />Green
</form>
</body>
</html>

0 个答案:

没有答案