Out Of Memory Error When loading more images in Glide

前端 未结 11 920
我寻月下人不归
我寻月下人不归 2020-12-31 06:32

Edited:

  • In my application, I am loading more than 300 images in home page. I used glide to load images. I\'m getting Out of
11条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 06:44

    I faced the similar problem . I am sharing the way I solved it . Create a folder named drawable-nodpi put your golive_load_image and golive_cancel_im‌​age file into that folder , and remove those two image file from other place like drawable-ldpi,drawable-hdpi etc (if you have there ) . And add skipMemoryCache( true )

         Glide.with(context).load(rowItem.getPosteduserpostimage())
                                .skipMemoryCache( true )
                                .placeholder(R.drawable.golive_load_image).error(R.drawable.golive_cancel_image)
                                .override(600, 200)
                                .into(holder.ivPostedImage);
    

提交回复
热议问题