Android:从源码看onSaveInstanceState的调用条件

Posted bdmh

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android:从源码看onSaveInstanceState的调用条件相关的知识,希望对你有一定的参考价值。

 Called to retrieve per-instance state from an activity before being killed so that the state can be restored in onCreate or onRestoreInstanceState (the Bundle populated by this method will be passed to both).
This method is called before an activity may be killed so that when it comes back some time in the future it can restore its state. For example, if activity B is launched in front of activity A, and at some point activity A is killed to reclaim resources, activity A will have a chance to save the current state of its user interface via this method so that when the user returns to activity A, the state of the user interface can be restored via onCreate or onRestoreInstanceState.
Do not confuse this method with activity lifecycle callbacks such as onPause, which is always called when the user no longer actively interacts with an activity, or onStop which is called when activity becomes invisible. One example of when onPause and onStop is called and not

以上是关于Android:从源码看onSaveInstanceState的调用条件的主要内容,如果未能解决你的问题,请参考以下文章

从源码角度看Android系统SystemServer进程启动过程

Android从源码看ListView的重用机制

Android:从源码看权重Weight的计算

Android:从源码看权重Weight的计算

<转>如何高效快速看懂Android源码

有没有适合 Android 开发初学者的 App 源码推荐