Possible Duplicate:
WebView load website when online, load local file when offline
I want to view website in cache ie in offline mode. I tried, but it fails in offline
showing "www.google.com"
webpage not availabe. Generally the use of cache is to show the
webpage temporarily in offline. But I couldnt find the solution.Please help me. My code is as follows:
{ wt=(WebView)findViewById(R.id.webViewt);
wt.getSettings().setAppCacheMaxSize(1024*1024*8);
wt.getSettings().setAppCachePath("/data/data/"+ getPackageName() +"/cache");
wt.getSettings().setAllowFileAccess(true);
wt.getSettings().setAppCacheEnabled(true);
wt.getSettings().setJavaScriptEnabled(true);
wt.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
wt.loadUrl("http://www.google.com");
}