简体   繁体   English

Android,在后台运行应用

[英]Android, running an app in the background

I have an app which consists of a simple GUI and a few Broadcast receivers. 我有一个应用程序,其中包含一个简单的GUI和一些广播接收器。 I found somewhere on here how to start an app on boot of the device but cant seem to locate it atm. 我在这里找到了如何在设备启动时启动应用程序,但似乎无法找到它的atm。 However i need more i need it to start in the background and just listen using the broadcast receivers and then return to this state after the Gui(the visible part of the app) has been used. 但是我需要更多我需要它从后台开始,仅使用广播接收器收听,然后在使用Gui(应用程序的可见部分)后返回此状态。 Is there a way of doing this? 有办法做到这一点吗? Thanks. 谢谢。

Look into the Service class. 查看Service类。 Services run in the background and have no direct user interaction. 服务在后台运行,没有直接的用户交互。

http://developer.android.com/reference/android/app/Service.html http://developer.android.com/reference/android/app/Service.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM