How to load large images in Android and avoiding the out of memory error?

后端 未结 6 2012
梦谈多话
梦谈多话 2020-12-01 08:05

I\'m working on an app that uses large images (1390 × 870 : 150kb - 50kb). I\'m adding images as I tap a trigger/ImageView.

At a certain point I\'m getting an out of

6条回答
  •  有刺的猬
    2020-12-01 08:44

    Use Fresco library to load large images will avoid this error. in xml layout

    
    

    and in javacode

    Uri uri = Uri.parse("https://image.png");
    SimpleDraweeView draweeView = (SimpleDraweeView) findViewById(R.id.my_image_view);
    draweeView.setImageURI(uri);
    

提交回复
热议问题