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

前端 未结 6 1433
感动是毒
感动是毒 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:09

    You can download the whole text first, then the images only as they are displayed. Don't download the whole list of images, because maybe most of them are never going to be shown.

    Try to go a step ahead from the user. For instance, if the list can display 6 images when you first enter the activity, have these 6 prefetched before you switch to this activity, and pass them via Intent. You can also have a thread that downloads the following (3 or 4) images that would be displayed if the user scrolls down.

    To speed up the process, consider have the images pre-scaled, so their size is smaller and the download is faster.

提交回复
热议问题