You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using your app to load images that are being changed on the server every few minutes and I'd like to load new ones. Unfortunately, when an image is loaded with this library, it is stored in the cache and you can't view new image. I'd suggest you to add something like bigImageView.useCache(false);. Currently, I'm using this code to clear cache, but it's not perfect, I guess... (cache clearing provided by the library would be better):
@Override
protected void onStop(){
super.onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
try {
trimCache(this);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void trimCache(Context context) {
try {
File dir = context.getCacheDir();
if (dir != null && dir.isDirectory()) {
deleteDir(dir);
}
} catch (Exception e) {
}
}
public static boolean deleteDir(File dir) {
if (dir != null && dir.isDirectory()) {
String[] children = dir.list();
for (int i = 0; i < children.length; i++) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
}
}
return dir.delete();
}
The text was updated successfully, but these errors were encountered:
Hi, I'm using your app to load images that are being changed on the server every few minutes and I'd like to load new ones. Unfortunately, when an image is loaded with this library, it is stored in the cache and you can't view new image. I'd suggest you to add something like
bigImageView.useCache(false);
. Currently, I'm using this code to clear cache, but it's not perfect, I guess... (cache clearing provided by the library would be better):The text was updated successfully, but these errors were encountered: