问题描述
即时接收广播接收机的意图,然后我开始服务做更多的工作。现在如果该设备是睡觉,这一点,我一定要得到Wakelock(AlarmManger?),为什么我需要它?请问我的服务将停止运行,如果该设备不用得到一个wakelock睡觉。
如果该设备是睡着了,首先,你会不会接收广播接收机的意图,因为该设备是睡着了。
您不需要,除非你想确保当你完成一些工作,保持运行的装置。
是的。
im receiving an intent in broadcast receiver and then i start service to do more work. now what if the device is sleep and this happen, do i have to get Wakelock (AlarmManger?), and why do i need it?does my service will stop running if the device goes to sleep without getting a wakelock.
If the device is asleep to begin with, you will not be "receiving an intent in broadcast receiver", because the device is asleep.
You don't "need it", unless you want to ensure the device stays running while you complete some work.
Yes.
这篇关于BroadcastReceiver的,服务和Wakelock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!