[android-developers] Parallel download images from different fragment

2013-04-03 Thread Danny D

I generally don't prefer loading images directly from the Fragment/Activity, 
because I typically use the images multiple places throughout the app and don't 
want the user to pay for the same data twice.

General solution: setup a Singleton image cache like described in the docs,  
along with an HttpURLConnection that will load requested images if they are not 
already cached. I've used an AsyncTask to make the request within the image 
cache code.  When a 'waited' image completes, send out a LocalBroadcast so that 
any interested Activities/Fragments can be notified and can react.  If a second 
request comes in for the same image, I don't create a new AsyncTask.

-- 
-- 
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.




[android-developers] Parallel download images from different fragment

2013-04-02 Thread tsioularisa
i have one gui with 3 tabs . The second Tab is a gridview which downloads 
images from the internet asynchronously using the bitmapfun code from Android 
Developershttp://developer.android.com/training/displaying-bitmaps/index.html 
. 
the third tab also downloads 2 bitmaps from the internet using the same 
code. The problem is that the images that are being downloaded from the 
gridview are being affected from the third tab and they pause until the two 
other images have been downloaded. How can i download the images in the two 
fragments independent? If you want more information please tell me!

-- 
-- 
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.