在 onStop() 或 super.onStop() returns 之后 Activity 是否可以终止
Is Activity killable after onStop() or super.onStop() returns
我正在阅读有关 Activity
生命周期方法的文档 here
这是文档中 table 的快照。
onStop()
方法在那里被标记为可终止。然而,尚不清楚 Activity
何时可以杀死 - 在基础 Activity
returns 或派生的 onStop()
之后(扩展基础 Activity
) returns.
根据下面的引述:
Note the "Killable" column in the above table -- for those methods that are marked as being killable, after that method returns the process hosting the activity may be killed by the system at any time without another line of its code being executed.
还有这个:
For those methods that are not marked as being killable, the activity's process will not be killed by the system starting from the time the method is called and continuing after it returns. Thus an activity is in the killable state, for example, between after onStop() to the start of onResume(). Keep in mind that under extreme memory pressure the system can kill the application process at any time.
感觉是子类的onStop
方法的意思,但还是有疑问。有谁知道是什么意思吗?
请在文档或源代码中提供具体证明。
文档中的另一个声明:
Starting with Honeycomb, an application is not in the killable state until its onStop() has returned.
很明显,一个函数returns到达末尾时(在执行基类和子类的代码之后)。
我正在阅读有关 Activity
生命周期方法的文档 here
这是文档中 table 的快照。
onStop()
方法在那里被标记为可终止。然而,尚不清楚 Activity
何时可以杀死 - 在基础 Activity
returns 或派生的 onStop()
之后(扩展基础 Activity
) returns.
根据下面的引述:
Note the "Killable" column in the above table -- for those methods that are marked as being killable, after that method returns the process hosting the activity may be killed by the system at any time without another line of its code being executed.
还有这个:
For those methods that are not marked as being killable, the activity's process will not be killed by the system starting from the time the method is called and continuing after it returns. Thus an activity is in the killable state, for example, between after onStop() to the start of onResume(). Keep in mind that under extreme memory pressure the system can kill the application process at any time.
感觉是子类的onStop
方法的意思,但还是有疑问。有谁知道是什么意思吗?
请在文档或源代码中提供具体证明。
文档中的另一个声明:
Starting with Honeycomb, an application is not in the killable state until its onStop() has returned.
很明显,一个函数returns到达末尾时(在执行基类和子类的代码之后)。