//優先使用快取:
webview.getsettings().setcachemode(websettings.load_cache_else_network);
[html]view plain
copy
<
p>
//不使用快取:
webview.getsettings().setcachemode(websettings.load_no_cache);
p>
[html]view plain
copy
[html]view plain
copy
退出的時候加上下面**
[html]view plain
copy
file
file
= cachemanager
.getcachefilebasedir();
if (file != null && file.exists() && file.isdirectory())
file.delete();
}
context.deletedatabase("webview.db");
context.deletedatabase("webviewcache.db");
原文:
android快取清理
獲取包名的應用快取 在生命週期方法oncreate中先呼叫一次getcachesize packagemanager pm getactivity getpackagemanager listinfos pm.getinstalledpackages 0 for packageinfo info i...
Android 清空快取
public class param context param catchpathstring 快取路徑 return throws exception 當前快取大小 public static string gettotalcachesize context context,string cat...
android清除快取
現在程式中一般都是有快取顯示並且清除快取操作的,那麼具體是怎麼來實現的呢?其實很簡單,乙個utils就搞定了,下面就給大家粘出來 清除快取 param context public static void clearallcache context context private static bo...