Setting the background of an Activity

后端 未结 3 1888
南旧
南旧 2020-12-04 01:15

In the onCreate() method of my Activity, I grab the outermost LinearLayout of the Activity\'s layout. I then check to see what the orientation of the phone is. If it is po

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 01:43

    That happens because the previous image remains in memory until the garbage collector clean it, and everytime the user open an close the keyboard, a new activity is created and a new instance of an image is done. So to prevent that crash, clean the memory on your activity. Use what Femi said, in case it is a bitmap, or force a call to the garbage collector

提交回复
热议问题