简体   繁体   English

Android BOOT_COMPLETED

[英]Android BOOT_COMPLETED

I have a question concerning the BOOT_COMPLETED event. 我有一个关于BOOT_COMPLETED事件的问题。 I need a service to be running at all time (done via AlarmManager) but I wonder if I have to start the service manually the first time the application is installed as the BOOT_COMPLETED event is sent only after the device is restarted. 我需要一直运行一项服务(通过AlarmManager完成),但是我想知道是否必须在首次安装该应用程序时手动启动该服务,因为仅在重启设备后才发送BOOT_COMPLETED事件。 How is this commonly handled, it seems like no one is having this problem, am I getting something wrong here? 通常如何处理,似乎没人遇到这个问题,我在这里弄错了吗?

用户应该是决定服务在首次安装时是否正在运行的人,而不是您,因此是的,应该在他们首次启动该应用程序时手动启动该服务

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

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