Out Of memory error using Universal Image Loader and images getting refreshed

前端 未结 3 1759
滥情空心
滥情空心 2020-12-18 10:20

I am using the universal image loader to display the images as thumbnail in ListView however i am getting the out of memory error and when i scroll the list than the new vie

3条回答
  •  半阙折子戏
    2020-12-18 10:32

    try next (all of them or several):

    Reduce thread pool size in configuration (.threadPoolSize(...)). 1 - 5 is recommended. Use

     .bitmapConfig(Bitmap.Config.RGB_565)     
    

    in display options. Bitmaps in RGB_565 consume 2 times less memory than in ARGB_8888. Use

    .memoryCache(new WeakMemoryCache()) 
    

    in configuration or disable caching in memory at all in display options (don't call .cacheInMemory()). Use

    .imageScaleType(ImageScaleType.IN_SAMPLE_INT)
    

    in display options. Or try

    .imageScaleType(ImageScaleType.EXACTLY).
    

    Avoid using RoundedBitmapDisplayer. It creates new Bitmap object with ARGB_8888 config for displaying during work.

提交回复
热议问题