杀死从任务管理器Android应用程序启动杀敌通过应用服务 [英] Killing android application from task manager kills services started by app

查看:284
本文介绍了杀死从任务管理器Android应用程序启动杀敌通过应用服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序有一个活动而启动两项服务,但不将它们绑定。如果我选择返回按钮退出应用程序(我看不到它在任务管理器),都是由应用程序启动的服务的持续运行。但是,如果我转到任务管理器杀应用程序,这两个服务都停止。我不知道这是否是有意的行为,但我想要的服务,即使退出应用程序继续运行。任何想法吧。

My application has one activity which starts two services but does not bind them. If I select return button to exit application (I cannot see it in task manager), both of the services started by application keep running. However, if I goto task manager and kill application, both of the services are stopped. I am not sure if it is intended behaviour but I want the services to keep running even after application exits. Any thoughts please.

感谢

推荐答案

这是任务管理的(和强制停在ManageApplication)预期的行为。有什么好处将停止应用程序做的,如果它一直运行在后台的工作,该应用程序在做什么?

That is the intended behavior of Task Managers (and force stop in ManageApplication). What good would stopping an application do if it left running the background work that the application was doing?

有没有办法让你prevent从股票版本的Andr​​oid OS

There is no way for you to prevent the user from killing your service on a stock version of Android OS

这篇关于杀死从任务管理器Android应用程序启动杀敌通过应用服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆