安卓 v2.2-2.3.5 : WebView : loadDataWithBaseURL : will only load page once

标签 android webview loaddata

当我使用.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/

相关文章:

Android:仅阻止单个 Activity 访问互联网

使用 RxJava 或 kotlin 协程的 Android ViewState

java - AlertDialog.Builder 类型中的 setPositiveButton(int, DialogInterface.OnClickListener) 不适用于参数

android - SDK平台工具版本(24.0.3)太旧,无法检查使用API​​ 25编译的API [警告]

ios - 通过委托(delegate)传递数据后无法将数据加载到 TableView

django - 从 Django 数据库导出数据

excel - 如何从 Excel 或记事本(以 .txt 结尾的文档)将数据加载到 Win Bugs 中?

java - 如何等待 Retrofit 异步 Web 服务调用? (调用.入队)

jquery - 如何在 javafx webview 中包含 jquery?

javascript - Android Webview 不加载 javascript 注入(inject)的图像