当 Android 设备拔掉插头并处于睡眠状态时,我可以唤醒它吗?
我制作了一个应用程序,可以让人们收听广播,并实现了闹钟,这样我就可以在闹钟响起时播放广播。我正在使用alarmManager和RTC_wakeup,如果手机已插入或手机未睡眠(这违背了目的),它似乎工作正常。然而,当手机拔掉插头并处于睡眠状态时,闹钟不会响起,直到我唤醒手机。
有谁知道这个问题的解决方案?
I have made an app that allows one to listen to the radio and have implemented an alarm so that I can have the radio play when the alarm goes off. I am using the alarmManager and RTC_wakeup, and it seems to work fine if the phone is plugged in or if the phone is not asleep (which kind of defeats the purpose). When the phone is unplugged and asleep, however, the alarm does not go off until I wake up the phone.
Does anyone know a solution to this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我们的做法,它适用于您描述的两种情况:
This is how we did it and it works in both case that you describe: