Handle Android Out of memory exception (个人总结的如何应对Android内存不足)
16lz
2021-01-23
1.http://blog.jteam.nl/2009/09/17/exploring-the-world-of-android-part-2/
2.Recycle Drawable:
Drawable.setCallback(null)
View.unscheduleDrawable(who)
BitmapDrawable.getBitmap().recycle()
3.New a thread to decode in background
4. Cache drawable(bitmap) (limit to a number) and Recycle bitmap when out of current cache scope.
ImageView.setImageBitmap(null)
bitmap.recycle()
bitmap = null
此处有个好贴,全面介绍了如何应对内存问题。
更多相关文章
- android释放内存的一个办法
- 操作内存卡的常用代码
- android 加载图片防止内存溢出
- Android获取系统的内存使用率
- android 缩放图片与内存溢出
- Android调用C++实现共享内存(Native层)
- Android Dalvik 内存管理学习