how to remove cache from webView

后端 未结 1 1296
难免孤独
难免孤独 2020-12-12 06:29

I have recyclerView and in each items I\'ve have displaced facebook in webView. I loged in one of the item (position 1) of the webview by facebook. And, all other items (pos

相关标签:
1条回答
  • 2020-12-12 07:21

    You can try this way. Hope it should work.

    CookieManager cookieManager = CookieManager.getInstance();
    
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
           cookieManager.removeAllCookies(new ValueCallback<Boolean>() {
          
             @Override
             public void onReceiveValue(Boolean aBoolean) {
                   Log.d(TAG, "Cookie removed: " + aBoolean);
             }
           });
    }
    else {
    cookieManager.removeAllCookie()
    }
    webView.clearCache(true);
    webView.clearFormData();
    webView.clearHistory();
    
    0 讨论(0)
提交回复
热议问题