简体   繁体   English

启动没有接口的应用程序以接收boot_completed

[英]Launch application without an interface to receive boot_completed

I have developed a Service for Android that starts when BOOT_COMPLETED is received.It works fine on versions prior to 3.1. 我已经开发了一个Android服务,它在收到BOOT_COMPLETED时启动。它在3.1之前的版本上运行正常。

I newer versions tough I understand the application must be launched in order to receive this broadcast . 我更新版本很难理解必须启动应用程序才能接收此广播。 How can I launch my application if I don't have an User Interface ? 如果我没有用户界面,如何启动我的应用程序?

You add a user interface, in the form of an activity that the user can launch. 您可以以用户可以启动的活动的形式添加用户界面。 Besides, this is where you need to: 此外,这是您需要的地方:

  • Allow the user to stop and start your service, since the user may not want your service to be running 24x7 and you do not want the user to have to resort to Force Close 允许用户停止并启动您的服务,因为用户可能不希望您的服务全天候运行,并且您不希望用户必须诉诸强制关闭

  • Display your documentation 显示您的文档

  • Display your license agreement 显示您的许可协议

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

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