glide清缓存
/** * 清除图片所有缓存 */ public void clearImageAllCache(Context context) { clearImageDiskCache(context); clearImageMemoryCache(context); String ImageExternalCatchDir=context.getExternalCacheDir()+ ExternalCacheDiskCacheFactory.DEFAULT_DISK_CACHE_DIR; deleteFolderFile(ImageExternalCatchDir, true); } /** * 获取Glide造成的缓存大小 * * @return CacheSize */ public String getCacheSize(Context context) { try { return getFormatSize(getFolderSize(new File(context.getCacheDir() + "/"+ InternalCacheDiskCacheFactory.DEFAULT_DISK_CACHE_DIR))); } catch (Exception e) { e.printStackTrace(); } return ""; }
相关推荐
Lzs 2020-10-23
聚合室 2020-11-16
零 2020-09-18
Justhavefun 2020-10-22
jacktangj 2020-10-14
ChaITSimpleLove 2020-10-06
Andrea0 2020-09-18
周游列国之仕子 2020-09-15
afanti 2020-09-16
88234852 2020-09-15
YClimb 2020-09-15
风雨断肠人 2020-09-04
卖口粥湛蓝的天空 2020-09-15
stulen 2020-09-15
pythonxuexi 2020-09-06
abfdada 2020-08-26
梦的天空 2020-08-25