当我使用.loadData
或.loadDataWithBaseURL
加载页面时,系统将加载页面一次。
此后,后续调用将不起作用。
在 4.0.3 中,如果我使用新数据第二次调用该函数,它确实会发生变化。
如何在 2.2+ 版本中修复此问题?我是否要销毁 WebView 并创建一个新的?
webView1.loadDataWithBaseURL("file://", page, "text/html", "UTF-8", null);
webView1.loadUrl( "javascript:window.location.reload( true )" );
最佳答案
在 loadDataWithBaseURL 中,将最后一个参数设置为数据来源的 URL,而不是 null
。
关于安卓 v2.2-2.3.5 : WebView : loadDataWithBaseURL : will only load page once,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9960443/