Large ListView containing images in Android

前端 未结 7 1586
傲寒
傲寒 2020-12-15 13:50

For various Android applications, I need large ListViews, i.e. such views with 100-300 entries.

All entries must be loaded in bulk when the application

7条回答
  •  独厮守ぢ
    2020-12-15 14:19

    Do not store all of the images in a list because it's too heavy. You should start an AsyncTask in getView, get,decode you image in InBackground and draw an image on the imageView in PostExecute. To maintain performance of your list you could also use the convertView parameter from getView method, but it starts to be complicated with AsyncTask because your view can be recycled before AsyncTask finishes and you should handle this extra...

    You could use LruCache but this only make sense when images are downloaded from internet. When they are stored localy there is no point in using it.

提交回复
热议问题