Caused by: java.lang.OutOfMemoryError: Failed to allocate a 35624972 byte allocation with 4194304 free bytes and 28MB until OOM

前端 未结 2 1855
醉酒成梦
醉酒成梦 2021-01-16 07:41

Here is my code:

BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeResource(getResource         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-16 08:20

    This alerts you that in some devices you could have memory problems doing this. Try resizing the image to reduce his size. You also can set a larger memory heap witting android:largeHeap="true" in the manifest but i wouldn't recommend that.

提交回复
热议问题