Can somebody give good logic for set repeat days of week alarm? I have done weekly Alarm by using
alarmCalendar.set(Calendar.HOUR, AlarmHrsInInt);
alarmCalendar.set(Calendar.MINUTE, AlarmMinsInInt);
alarmCalendar.set(Calendar.SECOND, 0);
alarmCalendar.set(Calendar.AM_PM, amorpm);
Long alarmTime = alarmCalendar.getTimeInMillis();
Intent intent = new Intent(Alarm.this, AlarmReciever.class);
intent.putExtra("keyValue", key);
PendingIntent pi = PendingIntent.getBroadcast(Alarm.this, key, intent, PendingIntent.FLAG_UPDATE_CURRENT);
am.setRepeating(AlarmManager.RTC_WAKEUP, alarmTime, 7*1440*60000 , pi);
The alarm trigger on time and after 7 days it automatically triggers at that time.
But my requirement is I want to choose days rather than just 7 days.
something like every Monday, Tuesday, Thursday at 9:00 AM - Alarm should trigger automatically. How do I go about doing this in setRepeating.
Can somebody help me out with this?
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…