Skip to content Skip to sidebar Skip to footer

How Do I Improve The Performance Of A Listview?

When I use images from the internet in a Listview, my Listview scrolls very slowly. But in some applications such as Twitter, Google+ and other applications (despite showing images

Solution 1:

There are some ThumbRules which might help you in optimizing listview:

-> Reuse Views by using ConvertView, in

`getView(AdapterView<?> adapterView, View convertView, int position, longid)`

->. Use Lazy Loading for Loading images from web, see

http://codehenge.net/blog/2011/06/android-development-tutorial-asynchronous-lazy-loading-and-caching-of-listview-images/

-> Also use ViewHolders to improve inflation time.check link:

http://jmanzano.me/efficient-listviews-in-android-viewholder-pattern-2/

Solution 2:

Check out this one, list view performance optimization from Larse Vogella

You can also use endless list or lazy loading where you load only some part of data in listview & load other when user reaches bottom of list lazy loading OR Commonsware's adapter for endless loading

Solution 3:

use LoaderImageView in your listview. you can get LoaderImageView code from herehttp://blog.blundell-apps.com/imageview-with-loading-spinner/

modify the LoaderImageView code to store the drawable downloaded

Post a Comment for "How Do I Improve The Performance Of A Listview?"