【问题标题】:How to repeat the alarm for "n" days at a particular time如何在特定时间重复“n”天的警报
【发布时间】:2014-11-26 23:59:32
【问题描述】:

这是我每 24 小时设置一次闹钟的代码。我怎样才能只重复 20 天?

alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, 
     calendar.getTimeInMillis(), 
     24*60*60*1000, 
     pendingIntent);

【问题讨论】:

    标签: android alarmmanager


    【解决方案1】:

    这将永远重复,直到您取消它。所以,你能做的就是在 20 天内触发一些东西,然后在管理那个事件时,取消你的闹钟。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-12
      • 1970-01-01
      • 2014-08-09
      • 2018-02-17
      • 1970-01-01
      相关资源
      最近更新 更多