如何保持一个Android应用程序无限期地运行?应用程序、Android

2023-09-04 03:57:38 作者:爱到深处腿自开、

我写一个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

 
精彩推荐
图片推荐