Thanks guys. @Aaron, I'll take a look at Droid Fu
@Doug, I see a lot of applications that appear to be using multiple threads to download images. E.g., the Android market itself. It's kinda amazing to me that there isn't a standard way of doing this considering the number of applications I see that use a thumbnail/text ListView. On Nov 6, 1:53 pm, Aaron Windsor <[email protected]> wrote: > On Sat, Nov 6, 2010 at 4:42 PM, Open <[email protected]> wrote: > > I have an activity in my application that shows a listview of items > > with icons next two each item. I would like to lazy load icons for > > each item from the Internet using in memory caching and SD caching > > (very common Android use case). > > > I have been using this code from the Google Android developers blog: > >http://android-developers.blogspot.com/2010/07/multithreading-for-per... > > > And discovered that it is possible for this code to generate > 100 > > asynctasks, > > > Does anyone have a modified version of this they would be willing to > > share using a threadpool or some other mechanism to limit the number > > of background threads? > > I've used droid-fu (http://github.com/kaeppler/droid-fu/) for exactly > what you're describing, specifically the ImageLoader class within a > custom adapter. Whenever the ListView calls getView on the adapter, > you instantiate an ImageLoader, passing the ImageView that you want to > populate with your web image and the intended position in the ListView > as arguments. > > droid-fu also has a WebImageView which looks like it has some recent > changes that will allow it to be used as a drop-in replacement for > ImageViews within ListViews, so you may be able to use it and not even > fool with a custom adapter at all. > > -Aaron -- 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

