杀死应用程序后如何在后台执行某些任务 [英] How to do some task in background after kill the application

查看:103
本文介绍了杀死应用程序后如何在后台执行某些任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个应用程序.因为每次都会有一个任务在后台运行.我的问题是,如果我杀死该应用程序,那么该任务也将停止.但是我想在用户杀死应用程序后运行该任务.做这个.

i am doing one application.In that one task is running in background every time.My problem is,if i kill the application then that task also stopped.But i want to run that task after application killed by user.How to do this one.

推荐答案

用户杀死应用程序后,无法在后台运行任何类型的进程.看看Viber为他们的应用程序做了什么.

There is no way to run any kind of processes in the background after user kills the application. See what Viber does for their app.

因此,您可以通知用户不要退出该应用程序,但是您必须给他们一个有效的理由.而且,如果您的应用程序不是GPS或音乐应用程序,则您的应用程序不会在后台运行,并且您的所有进程都将被操作系统挂起,以节省电池寿命.

So you can give a notice to user not to quit the app, but you would have to give them a valid reason. And if your app is not GPS or Music app your app will not be active in the background and you all your processes will be suspended by the OS to save battery life.

这篇关于杀死应用程序后如何在后台执行某些任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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