我不明白为什么我不能创建警报管理器队列。一旦第一个警报,其他警报级联而不是会议时间。这是单击“开始”按钮时将调用的代码:
final AlarmManager[] alarmManager=new AlarmManager[50];
Integer i =0;
final Calendar calendar = Calendar.getInstance();
public void onClick(View arg0) {
Intent myIntent = new Intent(AndroidAlarmSMS.this,
MyAlarmService.class);
pendingIntent = PendingIntent.getService(AndroidAlarmSMS.this, i,
myIntent, 0);
thatDay.set(dataPick.getYear(), dataPick.getMonth(),dataPick.getDayOfMonth(), timePicker1.getCurrentHour(), timePicker1.getCurrentMinute());
calendar.setTimeInMillis(System.currentTimeMillis());
long diff = (thatDay.getTimeInMillis()- calendar.getTimeInMillis());
int sec = (int) (diff / 1000 % 60);
calendar.add(Calendar.SECOND,sec);//Sec it's the difference between time selected and now
alarmManager[i] = (AlarmManager)getSystemService(ALARM_SERVICE);
alarmManager[i].set(AlarmManager.RTC_WAKEUP,
calendar.getTimeInMillis(), pendingIntent);
i++;
}