现在,我正在使用以下方法加载图片:
的
的public static Drawable loadCachedImage(String strUrl) {
try {
URL url = new URL(strUrl);
URLConnection connection = url.openConnection();
connection.setUseCaches(true);
Object response = connection.getContent();
if (response instanceof Bitmap) {
Bitmap bitmap = (Bitmap)response;
return new BitmapDrawable(bitmap);
} else {
InputStream is = (InputStream) connection.getContent();
return Drawable.createFromStream(is, "src name");
}
} catch (Exception e) {}
return null;
}
的
AFAIK,它使用Android的默认缓存。所以,我想知道它存储给定应用程序信息的时间(或者存储的最大数据大小是多少)。这是设置配置吗?
提前致谢!
答案 0 :(得分:0)
缓存的范围取决于您的默认缓存存储,因为我们知道市场上有许多其他应用程序可用于清除缓存以用于其他用途。或者,如果用户可以从Settings->Application->Manage application->your app
手动清除缓存
在此显示应用程序的总大小。