android - Out of memory Exception

我们两清 提交于 2019-12-04 14:35:02

Bitmap converts the original size of the image x 4. So it occupies more heap which is specified to your app by android.

Use this when your Bitmap is no longer needed

bitmap.recycle();
bitmap = null;
Raghunandan

My guess is Bitmaps are not handled properly and that is creating a OutofMemoryException. Bitmaps should be recycled when not in use. Take a look here.. Also have a look at how to find memory leaks here using MAT Analyzer .

just change inSampleSize = 4 , if it is not working then increase it by 2's sequre

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!