MBek MBek -4 years ago 106
Android Question

Android - Imageview in listview how to reduce the lag?

I'm coding an app with android studio. This is a todolists manager in which you can also add images.

I have a Listview containing items with an ImageView in each. But when there are images to display the listview scrolls really slowly and the app lag.

I saw that I need to do something on a separate thread but how can I do this exactly ?

My app uses MVP and I create the listview with an adapter that extends "BaseAdapter" and uses "setURI" to put the image into the ImageView.

Answer Source

Hope this answer will help u Of course u have to use separate thread. U can use imageloader libraries for that according to ur need

Below are libraries link choose which u want to use:

  1. Glide: https://github.com/bumptech/glideenter link description here
  2. Picasso:https://github.com/square/picassoenter link description here

  3. Universal image loader: https://github.com/nostra13/Android-Universal-Image-Loaderenter link description here

Now which to choose I personally recommend glide.if u want to load big size image than go with universal image loader,if u want to go with small images than go with picasso

Hope this answer help u..if u want any other help u can ask for it

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download