Android 4.4 giving ERR_CACHE_MISS error in onReceivedError for WebView back

前端 未结 4 843
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 03:50

I have a webview in my Layout. By default, a search form is opened in it. On search, a listing section appears below the search form. If any link in the list is clicked, the

4条回答
  •  暖寄归人
    2020-11-30 04:20

    Use

    if (Build.VERSION.SDK_INT >= 19) {
            mWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
        }
    

    It will fix ERR_CACHE_MISS in the WebView. Maybe you will need to change it to SDK_INT == 19 after some Lollipop WebView updates, but it works for now.

提交回复
热议问题