我有这个WebView,我从服务器获取HTML。
String Body = "<html> <head> <style> body { background-color: clear !important; } p,div,span,li { color:black; font-size:17px !important;background-color: clear !important;} embed, iframe, object, video {height: 160px; width: 355.0px;} img { height: 160px; width: 355.0px; } </style> </head> <body><p>" +
BodyDetails +
"</p>" +
"</div></p></body> </html>";
Log.d("currentContent != null", Body);
CustomTextViewDetail.getSettings().setJavaScriptEnabled(true);
CustomTextViewDetail.loadData("", "text/html; charset=utf-8", "UTF-8");
CustomTextViewDetail.loadData(Body, "text/html; charset=utf-8", "UTF-8");
CustomTextViewDetail.getSettings().setBuiltInZoomControls(true);
CustomTextViewDetail.getSettings().setDisplayZoomControls(false);
我的问题是,当我更改HTML内容时,网页视图仍会显示最后一些内容未加载新内容!
如何刷新或解决此问题?
答案 0 :(得分:0)
更改数据后调用myWebView.reload()
。