简体   繁体   English

我怎么知道Android应用程序是否被用户明确杀死?

[英]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.

相关问题 我如何知道我的SyncAdapter(addPeriodicSync)是否已在Android中注册? - How do I know whether my SyncAdapter (addPeriodicSync) registered in Android or not? 我如何知道我的Android应用程序是否在后台运行? - How do I know whether or not my Android app is running in background? 如何知道Android中的应用程序是否启用了通知? - How to know whether Notifications are enabled or not for an application in android? Android服务杀死了低内存-如何让用户知道 - Android Service killed low memory - how to let user know 我如何知道用户在android中的共享意图中选择了哪个应用程序 - How do I know which application is selected by user in Sharing Intent in android 如何知道我是否在 Android 上通话? - How to know whether I am in a call on Android? 我如何知道已登录的用户是新创建的用户还是现有的用户? - How do I know whether a signed In user is a newly created user or existing? 我如何知道应用程序何时在 Expo 中被杀死? - How do I know when the app is killed in Expo? 我怎么知道用户是否在Android中收到弹出对话框以进行位置访问权限检查? - How can I know that whether user has received the pop up dialog for location access permission check or not in Android? 我怎么知道用户是观看了我的全额奖励视频广告还是在Android中跳过了广告? - how can I know whether a user has watched my full rewarded video ad or skip ad in android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM