FATAL EXCEPTION: main java.lang.OutOfMemoryError at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)

后端 未结 4 1110
时光取名叫无心
时光取名叫无心 2021-01-15 04:42

I keep getting this error when I run my app. The app will compile fine and once I start interacting with it (ImageSlider) sometimes it breaks and comes up with that message.

4条回答
  •  暖寄归人
    2021-01-15 05:08

    You should look at this article on android dev site http://developer.android.com/training/displaying-bitmaps/index.html . You should load bitmap asynchronously, because you are decoding file and its expensive operation and you should also first load bitmap size and than scale it to real size of imageview

提交回复
热议问题