Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>These questions talk about the same thing as you want. Those answers will be helpful:</p> <p>You just need to specify the day to start it and then repeat it every 7 days. There are few ways specified in answers on given questions:</p> <p><a href="https://stackoverflow.com/questions/14272295/how-can-i-get-the-repeat-alarm-for-week-days-using-alarm-manager">How can i get the repeat alarm for week days using alarm manager?</a></p> <p><a href="https://stackoverflow.com/questions/14156950/android-notification-on-specific-weekday-goes-off-directly">Android Notification on specific weekday goes off directly</a></p> <p><a href="https://stackoverflow.com/questions/12507901/how-to-repeat-alarm-week-day-on-in-android">how to repeat alarm week day on in android</a></p> <p><strong>Update:</strong></p> <p>In your comment you said </p> <blockquote> <p>How to set the triggerAtMillis part in setRepeating. say for example today is Tuesday, I choose weekly Monday, Wednesday, Friday. - What do I put for Wednesday ?</p> </blockquote> <p>What I understood that that if today is Tuesday, how to set alarm for lets say Wednesday repeating, right? First of all yes you can use mulltiple id's to set alarms for each day separately. </p> <p>Then you can add <code>alarmCalendar.set(Calendar.DAY_OF_WEEK, week);</code> line to your existing code. Based on the week day( from 1-7) it repeats for that day. You can pass it into a function as parameter. Like:</p> <pre><code> setAlarm(2); //set the alarm for this day of the week public void setAlarm(int dayOfWeek) { // Add this day of the week line to your existing code alarmCalendar.set(Calendar.DAY_OF_WEEK, dayOfWeek); 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(); //Also change the time to 24 hours. am.setRepeating(AlarmManager.RTC_WAKEUP, alarmTime, 24 * 60 * 60 * 1000 , pi); } </code></pre> <p>I've taken the example from one of above question. Hope its more clear now. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload