如何重复报警" N"在特定的时间天 [英] How to repeat the alarm for "n" days at a particular time

查看:122
本文介绍了如何重复报警" N"在特定的时间天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的code设置报警每24小时。我怎么能重复这个只有20天呢?

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


解决方案

直到你取消它,将永远重复。所以,你可以做什么,这是火的东西在20天内,并管理该事件时,取消报警。

This is my code to set the alarm for every 24 hours. How can I repeat this for 20 days only?

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

解决方案

that will be repeating forever until you cancel it. So, what you can do, it's to fire something in 20 days,and when managing that event, cancel your alarm.

这篇关于如何重复报警" N"在特定的时间天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆