[英]How do i know whether android application explicitly killed by user or not?
I have an application which uses some resources internally. 我有一个内部使用一些资源的应用程序。
Problem : if user explicitly removes application from recent apps list, it kills the entire application but i must close resources when application is killed explicitly. 问题:如果用户从最近的应用程序列表中明确删除应用程序,它将杀死整个应用程序,但是当应用程序被明确终止时,我必须关闭资源。
Is there any callback method is calling when application is closed by the user ? 用户关闭应用程序时是否正在调用任何回调方法?
What's the difference if the user kill your app/ the system kill your app or just the user move to another app and put your app in background. 如果用户杀死您的应用程序/系统杀死了您的应用程序,或者仅仅是用户移至另一个应用程序并将您的应用程序置于后台,那会有什么区别。
In any case you shouldn't leave open resources when you app isn't active. 无论如何,当您的应用处于非活动状态时,您都不应留下开放资源。 Just close all resources on onStop
of your activity 只需关闭onStop
活动中的所有资源
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.