这是我的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.