如何保持一个Android应用程序无限期地运行? [英] How to keep an Android app running indefinitely?

查看:144
本文介绍了如何保持一个Android应用程序无限期地运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个Android应用程序必须始终在后台运行,直到用户从应用程序的菜单中退出了。但现在我发现,在Android的一段时间后,我的应用程序本身停止,无需用户干预。

I am writing an Android app which must always be running in the background until the user exits it from the app's menu. But now I notice that in Android after some time my app is stopped by itself without user intervention.

不知道如何确保我的应用程序将始终在后台运行?

Any idea how to make sure my app will always be running in the background?

推荐答案

您需要运行你自己的服务。 http://developer.android.com/reference/android/app/Service.html

You need to run a Service of your own. http://developer.android.com/reference/android/app/Service.html

这篇关于如何保持一个Android应用程序无限期地运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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