[英]Repeat Alarm in day time only
I need to remind user about their tablets to be intaken at specific interval in day time only. 我需要提醒用户有关他们的平板电脑只能在一天中的特定时间间隔内服用。 I know how the notification and alram manager works.
我知道通知和Alram管理器的工作方式。 But don't know how can I solve my above mentioned problem.
但是不知道如何解决上述问题。 Sometimes in between I need to stop/cancel that repeating alarm.
有时在这之间,我需要停止/取消该重复警报。
Any help will be greatly appreciated. 任何帮助将不胜感激。
regds, Pratheeja regds,Pratheeja
You can use the PendingIntent you fire to reset the alarm every time it goes off by adding a new alarm in 24 hours. 您可以使用触发的PendingIntent在每次关闭后通过在24小时内添加新警报来重置警报。 Don't forget to add a BroadcastReceiver that receives device boot action (
android.intent.action.BOOT_COMPLETED
) as alarms get deleted on device boot and you would have to reset the alarm to the remaining time. 不要忘记添加一个接收设备启动操作(
android.intent.action.BOOT_COMPLETED
)的BroadcastReceiver,因为在设备启动时删除了警报,您必须将警报重置为剩余时间。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.