Essentially, I am creating an alarm app, and would like to use the setAlarmClock method instead of setRepeating to set an alarm that recurs every day (or if possible select days) using a calendar instance. I am wondering if you can set the DAY_OF_WEEK parameter to multiple values, or a variable containing a list of values. My code would look something like this:
AlarmManmager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(this, AlertReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 1, intent, 0);
Calendar c = Calendar.getInstance();
c.set(Calendar.DAY_OF_WEEK, //some variable with multiple day values here);
c.set(Calendar.HOUR_OF_DAY, hourOfDay);
c.set(Calendar.MINUTE, minute);
c.set(Calendar.SECOND, 2);
AlarmManager.AlarmClockInfo ac= new AlarmManager.AlarmClockInfo(c.getTimeInMillis(),pendingIntent);
Help is much appreciated, Thanks!
You can use TimesSquare library and CalendarPickerView for choosing multiple dates as presented here at GitHub.
Basically with this library, you can choose multiple dates inside one CalendarPicker and get all selected dates as a list of dates.