【问题标题】:Android WebView goBack not working for post requestAndroid WebView goBack 不适用于发布请求
【发布时间】:2014-03-25 10:28:10
【问题描述】:

我在我的 WebClient 中覆盖了 onFormResubmission 函数。但是,当从 post 请求中点击 goBack 到页面时,它仍然会显示“WebPage not available”。

有人对此有想法吗?谢谢!

    private class NormalWebViewClient extends WebViewClient {
        @Override
        public void onFormResubmission(WebView view, Message dontResend, Message resend) {
            resend.sendToTarget();
        }
}

【问题讨论】:

    标签: android post webview browser-history


    【解决方案1】:

    更改缓存模式似乎可以解决此问题:

    mWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
    

    在其他一些线程上看到了这个,它对我有用。为方便起见,“网页不可用”行为不会发生在运行 Android 4.2.2 的 Galaxy Nexus 上,但它确实发生在运行 Android 4.4.2 的三星 S4 上。我还不确定相关因素是操作系统版本还是设备。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-12
      • 2016-01-19
      • 2014-09-09
      • 1970-01-01
      • 2023-02-08
      相关资源
      最近更新 更多