Android:如何在设备重新启动后运行服务中的线程
设备重新启动后如何在后台运行线程。我正在尝试在设备重新启动后使用警报管理器重新安排警报。但不幸的是,重启后就响一次,并且预定的警报在重启后被清除。所以我必须在后台服务中运行一个线程,重新安排从数据库中获取时间的警报。如何实现?非常感谢任何帮助,并提前致谢...
How to run a thread in background, after the device is rebooted. I'm trying to re schedule the alarm using alarm manager after the device is rebooted. But miserably it is ringing once after reboot and the scheduled alarms are cleared after reboot. so i've to make a thread run in background service that re-schedules the alarm taking the time from the database. How to achieve it? any help is highly appreciated and thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过为 ACTION_BOOT_COMPLETED 设置 BroadcastReceiver 来侦听重新启动事件
You can listen for a reboot event by setting up BroadcastReceiver for ACTION_BOOT_COMPLETED