Android - 当应用程序被强行杀死时会发生什么
Android - what happens when the app is forcibly killed
至Android's Activities doc, it is said that the methods onStop() and onDestroy()不保证被调用
[...] once the activity is created, onPause() is the last method that's guaranteed to be called before the process can be killed—if the system must recover memory in an emergency, then onStop() and onDestroy() might not be called [...]
我想知道,出现这种情况时,是app在activity中也被kill了还是只是activity本身被kill了?
答案是应用程序进程也被杀死并且可以重新创建。
https://developer.android.com/training/basics/activity-lifecycle/recreating.html
请检查 http://www.vogella.com/tutorials/AndroidLifeCycle/article.html
仅具有已停止活动且没有服务或执行接收器的应用程序。 Android 将它们保存在最近最少使用 (LRU) 列表中,如果需要则终止最少使用的列表。
至Android's Activities doc, it is said that the methods onStop() and onDestroy()不保证被调用
[...] once the activity is created, onPause() is the last method that's guaranteed to be called before the process can be killed—if the system must recover memory in an emergency, then onStop() and onDestroy() might not be called [...]
我想知道,出现这种情况时,是app在activity中也被kill了还是只是activity本身被kill了?
答案是应用程序进程也被杀死并且可以重新创建。 https://developer.android.com/training/basics/activity-lifecycle/recreating.html 请检查 http://www.vogella.com/tutorials/AndroidLifeCycle/article.html 仅具有已停止活动且没有服务或执行接收器的应用程序。 Android 将它们保存在最近最少使用 (LRU) 列表中,如果需要则终止最少使用的列表。