且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在强制关闭的活动将重新启动

更新时间:2023-02-02 13:19:41

Here一些有用的信息:

至于活动重新启动时 - 如果进程运行   前台活动消失,系统将扔掉的活动,如果   它并没有为它(通常这意味着它暂停的有效保存状态   并给出了系统的onSaveInstanceState从之前的结果   暂停)。一旦它已决定是否要扔掉该活动,它   将恢复的任何活动,现在是在堆栈的顶部。如果这是   你的活动之一 - 要么是因为你有另外的后面一个   坠毁,或一个坠毁在某种程度上它的入驻暂停状态    - 然后再重新启动过程中显示,***的活动

As far as when an activity is restarted -- if the process running the foreground activity goes away, the system will throw away that activity if it does not have a valid saved state for it (typically meaning it is paused and has given the system the result of onSaveInstanceState from before the pause). Once it has decided whether or not to throw away that activity, it will resume whatever activity is now at the top of the stack. If this is one of your activities -- either because you have another behind the one that crashed, or the one that crashed was somehow it the settled pause state -- then it will start your process again to show that top activity.