Thank you. In my adapter's bindView method(), can I do something like only bind the text parts of the view first and spawn a thread to bind the imageView (i.e. loading the bitmap form file, create a bitmap object and call setImageBitmap to the imageView)?
But one problem I see this is I will end up spawning 1 thread per row in ListView, so that is kind of expensive. My ListView can ~ 50 rows. On Fri, Sep 18, 2009 at 4:37 PM, Mark Murphy <[email protected]> wrote: > > hap 497 wrote: >> Hi, >> >> I am trying to write a ListAdapter for an android ListView. >> >> In my ListAdapter's bindView(), I need to read a local file, generate >> a Bitmap and set the imageView of the row to this Bitmap. >> >> I find this kind of slow when running on G1. Is there any idea to help >> performance? > > Cache the images in RAM once you load them, so you do not re-load them > from the file when the user scrolls and then scrolls back. Maybe > pre-load the images if you know what they are in advance and know for > certain they will be used. > > You don't want to go overboard on this, lest you run out of memory. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://twitter.com/commonsguy > > Android App Developer Books: http://commonsware.com/books.html > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

