Android ListView with lots of same drawables performance -
i'm developing android app list view contains lots of drawables. of them same i'm trying use hashmap returns same allocated bitmap when it's needed still there lots of allocations , gc actions list gets stuck time time when scrolling.
what can optimize performance in such case?
caching method - loadimage using google code
mimageworker.loadimage(pic_url, holder.pic); holder.*some bitmap*.setimagebitmap(utility.getbitmap(context, id); //can 1 of 5 bitmaps use caching hashmap
try use lazy loading technique using caching, can find many tutorial on web:
also see this:
multithreading performance, tutorial gilles debunne.
this android developers blog. suggested code uses:
- asynctasks.
- a hard, limited size, fifo cache.
- a soft, garbage collected cache.
- a placeholder drawable while download.
Comments
Post a Comment