Is ondestroy not always called?

前端 未结 3 1403
借酒劲吻你
借酒劲吻你 2020-11-27 07:53

I have put some cache cleaning code in onDestroy of my activity but most of the time the code is not executed unless I explicitly finish the activity via

3条回答
  •  隐瞒了意图╮
    2020-11-27 08:06

    ondestroy is mostly called when the system completely removes the activity from memory, or when a user kills the activity, you want to save your data in on pause, as that will always be called before the destroy.

提交回复
热议问题