Please see this concerning the *execute* method for an AsyncTask:


<https://lh6.googleusercontent.com/-zRYXmRbRHfg/UWx7De5IsGI/AAAAAAAAAXk/vEGbuxjGl8w/s1600/message.png>



In particular, for certain versions of Android, your two tasks may run in 
parallel.  However, in Honeycomb onwards, they will not.


On what version of Android did you observe the problem?


Thanks.



On Monday, April 15, 2013 4:34:43 PM UTC-5, tsioularisa wrote:
>
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to