关于androidwebview的缓存问题

private void initWebView(WebView webview){
        String sdcache = getExternalCacheDir().getAbsolutePath();
        Log.i(TAG, sdcache);
        Log.i(TAG, "--------------------------------");
        WebSettings webSettings = webview.getSettings();
        webSettings.setJavaScriptEnabled(true);                
        webSettings.setDomStorageEnabled(true);
        webSettings.setDatabaseEnabled(true);
        webSettings.setAppCacheEnabled(true);
        webSettings.setAllowFileAccess(true);
        webSettings.setAllowContentAccess(true);
        webSettings.setAppCachePath(sdcache);    
        webSettings.setDatabasePath(sdcache);
        webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);        
        webSettings.setAppCacheMaxSize(1024*1024*50);
        
        webview.setWebViewClient(new WebViewClient(){

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                // TODO Auto-generated method stub
                return super.shouldOverrideUrlLoading(view, url);
            }

            @Override
            public void onPageFinished(WebView view, String url) {
                // TODO Auto-generated method stub
                super.onPageFinished(view, url);
            }

            @Override
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                // TODO Auto-generated method stub
                super.onPageStarted(view, url, favicon);
            }

            @Override
            public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
                // TODO Auto-generated method stub
                super.onReceivedError(view, request, error);
            }

            @Override
            public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
                // TODO Auto-generated method stub
                //super.onReceivedSslError(view, handler, error);
            }
            
            
        });
    }
    

这是设置缓存部分的代码把能设置的都设置上了 但是在DDMS中那个对应的路径下去找缓存的东西还是没有 路径是/storage/sdcard/Android/data/com.example.webviewtest/cache (用webview加载网页之后cache这个文件夹是空的)网页是没问题的。用application cache在html标签中配置了manifest="demo.appcache" 用google浏览器能看到application cache中有东西但是,第一次加载webview之后手机断网再加载webview时能被正常显示,但是就是找不到被缓存下来的东西,还有就是假如我要缓存一张a.jpg的图片 被缓存下来之后还是a.jpg吗还是是一个被加密过的文件啊,请问这是什么情况啊

查看回复