本文介绍了报警甚至在android的结束时间后触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建具有工作日选择小项目报警。 (我用报警管理器)。

I am creating small Alarm project which has week days option. (I am using alarm manager).

报警完美触发特定的时间和日期,但问题是,如果我更改日期或时间给定的闹钟时间后,它也引发任何previous报警。

The alarm triggers perfectly on given time and day but the problem is that it also triggers any previous alarm if I change the day or time after to the given alarm time.

对于如:

如果闹钟设置为上午5:00周一周三周五响铃。 - 而当前时间是下午6:00周日

If the alarm is set to ring at 5:00 AM Monday Wednesday Friday. - And the current time is 6:00PM Sunday.

和其他报警为下午4:00周一周三周五设置 - 当前时间是下午6:30周日

And another alarm set for for 4:00PM Monday Wednesday Friday - The current time is 6:30PM Sunday.

有关测试,我改变了一天至周二6:00 PM - 立即在两个报警触发逐一周一的日程安排。

For testing I changed the day to Tuesday 6:00PM - Immediately the two alarm triggers one by one for Monday's schedule.

我如何阻止这种特定的报警,而不是立即触发只能在下周一?我需要检查的日期也???

How do I stop this specific alarm and trigger only next Monday rather immediately? Do I need to check the dates also???

让我知道!

推荐答案

比较你的闹钟时间 System.currentTimeMillis的()

如果您的报警时间越小则当前的时间,比没有必要设置报警

if your alarm time is smaller then the current time, than no need to set the alarm

这篇关于报警甚至在android的结束时间后触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 04:57