于ccexp.WebView调用loadURL的清除本地缓存

webview访问网站,会有缓存

Android的源码:Cocos2dxWebViewHelper.java

    public static void loadUrl(final int index, final String url, final boolean cleanCachedData) {
        sCocos2dxActivity.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                Cocos2dxWebView webView = webViews.get(index);
                if (webView != null) {
                    webView.getSettings().setCacheMode(cleanCachedData ? WebSettings.LOAD_NO_CACHE
                                                                       : WebSettings.LOAD_DEFAULT);
                    webView.loadUrl(url);
                }
            }
        });
    }

有缓存的好处是下一次 进来会比较快

这样做:

webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE );

参考文档:

http://blog.csdn.net/typename/article/details/39030091

保存缓存的时候需要做网站的人,每次有新图片的时候最好换一下图片

参考文档

原文地址:https://www.cnblogs.com/zhangfeitao/p/7150588.html