which the smooth and fast way to load image from net in android list view!

前端 未结 6 1434
感动是毒
感动是毒 2021-02-06 19:33

i need to list out data from net in that i have 1 image and 2 text. i parse all data and display it but the image displaying very slow in list. so i m looking for best way to do

6条回答
  •  天涯浪人
    2021-02-06 20:29

    Download and displaying image in a List is a bit complicated matter. Some points that you need to consider are:

    1. Using different thread to doing the image download, you can use android asynctask class for this, you read about it here
    2. Caching your image, there are several way to achieve this, caching in memory, internal cache storage, or external cache storage(SD Card), and please read here
    3. You can use Lazy Loading on displaying the Images, it's mean the apps doesn't download all the images together in the same time, instead it downloads them one by one using queue, since user may not want to see all the result all together, you will waste network and battery resource, for this topic please read here

    I think it's better you learn about these, since they are very important. Hope it helps.

提交回复
热议问题