我正在考虑使用警报管理器,并在开发人员文档中阅读了这个,我不太明白。
"If your alarm receiver called Context.startService(),
it is possible that the phone will sleep before the
requested service is launched. To prevent this, your
BroadcastReceiver and Service will need to implement a
separate wake lock policy to ensure that the phone
continues running until the service becomes available."
我特别询问哪些情况下手机可能会在服务启动之前休眠(因为这是我不理解的部分)?是否取决于手机执行语句的速度?IE。它调用 startService() 打开另一个线程,因此原始线程可以在服务可用之前完成其工作?
谢谢