简体   繁体   English

Android生命周期

[英]Android Life cycle

In what cases on Destroy method is not called but application is killed out? 在什么情况下不会调用Destroy方法,但是应用程序被杀死了? I didn't make such situation, but need to do it. 我没有遇到这种情况,但需要这样做。 So I need to get a situation where on Destroy method will not be called but application will be killed? 因此,我需要得到一种情况,其中不会调用Destroy方法,但是应用程序将被杀死?

app is running that time you can press home button, check app is running in background that time you can directly kill this app. 应用当时正在运行,您可以按主页按钮,检查应用在后台运行,此时您可以直接杀死该应用。 this scenario onDestroy method didn't call. 此方案的onDestroy方法未调用。

onStop() will be called every time but onDestroy() will not be called if 每次都会调用onStop()但如果发生以下情况,则不会调用onDestroy()

• User remove application from recent •用户从最近删除的应用程序

• User force stop application from app info •用户通过应用信息强制停止应用

• User uninstalls application even if App is in background. •即使应用程序在后台,用户也会卸载应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM