如果在Activity中对一些资源以及状态进行保存操作,最好是在生命周期的哪个函数中进行呢?
-
onPause()
-
onCreate()
-
onResume()
-
onStart()
onPause:
Called when the system is about to
start resuming重新开始/恢复职位/继续 another activity.
This method is typically used
to commit
unsaved changes to persistent data提交未保存的变化给永久性数据, stop animations and
other things that may be consuming CPU, and so on. It should do
whatever it does very quickly, because the next activity will not be
resumed until it returns.