如何让 Android 应用无限期运行? [英] How to keep an Android app running indefinitely?

查看:44
本文介绍了如何让 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天全站免登陆