如何一次将闹钟设置为多个日期

How to set Alarm to multiple dates at same time once

我有以下代码来设置 alarm.It 在我的应用程序中为单个 date.But 工作用户可以 select 多个日期以及 he/she selects 多个日期 我必须在 selected time.eg 的每个 selected 日期设置闹钟 - 如果用户 selects 三个日期 11、12、13 和selects 时间早上 8 点然后闹钟应该在上午 8 点的 11、12、13 响起以下是我的代码,我在其中设置单个日期的闹钟

Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.MONTH, 0);
calendar.set(Calendar.YEAR, 2016);
calendar.set(Calendar.DAY_OF_MONTH, 11);

calendar.set(Calendar.HOUR_OF_DAY, alarmTimePicker.getCurrentHour());
calendar.set(Calendar.MINUTE, alarmTimePicker.getCurrentMinute());

Intent myIntent = new Intent(MainActivity.this, AlarmReceiver.class);
pendingIntent = PendingIntent.getBroadcast(MainActivity.this, 0, myIntent, 0);
alarmManager.set(AlarmManager.RTC, calendar.getTimeInMillis(), pendingIntent);

像这样PendingIntent对每个使用不同的请求代码

final int requestId = (int) System.currentTimeMillis();
pendingIntent = PendingIntent.getBroadcast(MainActivity.this, requestId, myIntent, 0);