You are right it is exactly as you wrote it! But if i don't implement it in
this way how can i achieve to clear the cache every time the user leaves
the activity? I think it is not good user experience to consume storage for
things that he can't use. Also i am not sure but if the file becomes too
large the new images won't be loaded. Also is this which produces the
problem that i mention before? Correct me if i am wrong but as i see from
the logcat it seems that BitmapWorkerTask is still alive in the background
and when the activity starts and this method is being called
public static boolean cancelPotentialWork(Object data, ImageView imageView)
{
final BitmapWorkerTask bitmapWorkerTask =
getBitmapWorkerTask(imageView);
if (bitmapWorkerTask != null) {
final Object bitmapData = bitmapWorkerTask.data;
if (bitmapData == null || !bitmapData.equals(data)) {
bitmapWorkerTask.cancel(true);
if (BuildConfig.DEBUG) {
Log.d(TAG, "cancelPotentialWork - cancelled work for "
+ data);
}
} else {
// The same work is already in progress.
return false;
}
}
return true;
}
the getBitampWokerTask(imageView) doesn't return null as it should. It is
very strange why this thing doesn't happen when i use only the wifi and
make the same steps! I can also post the logcat in the case where the
activity works fine if this helps you!
Sorry for my English!
--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.