於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

保存緩存的時候需要做網站的人,每次有新圖片的時候最好換一下圖片

參考文檔


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM