OutOfMemoryError when loading activities

后端 未结 3 1136
挽巷
挽巷 2021-01-03 09:26

I have a quite simple activity like this :

public class SurvivalActivity extends Activity {
    private static final String KEY_LAYOUT_ID = \"SurvivalLayoutI         


        
3条回答
  •  孤独总比滥情好
    2021-01-03 10:14

    The best way to optimize memory usage with bitmaps in your case is to save a list of your ImageViews make this before call finish() for every ImageView:

    ((BitmapDrawable) myImageView.getDrawable()).getBitmap().recycle();
    myImageView = null;
    

提交回复
热议问题