35岁中年男人在资本主义社会下的孤独。不错。
作者: CouldHll
《杂的文》
AnimationDrawable导致OOM内存泄露
问题描述:今天做ZTE,发现反复运行,会OOM。
问题解决:Google了如下解决办法,果然有效。
- Move code for AnimationDrawable to onResume() method.
- Add following code for releasing memory to onPause().
ad.stop(); for (int i = 0; i < ad.getNumberOfFrames(); ++i){ Drawable frame = ad.getFrame(i); if (frame instanceof BitmapDrawable) { ((BitmapDrawable)frame).getBitmap().recycle(); } frame.setCallback(null); } ad.setCallback(null);










