В моем приложении я хочу установить другой сигнал тревоги на другую дату.Так возможно ли с этим кодом:
//For Broadcast Alarm
alarmManager = (AlarmManager) getApplicationContext().getSystemService(Context.ALARM_SERVICE);
Intent in = new Intent(this, AlarmReceiverNotificationForTwoMonth.class);
pendingIntentOfTwoMonth = PendingIntent.getBroadcast(this, 0, in, 0);
// for the GST 20 June 2011
Calendar calendar_GST_18_June_2011 = Calendar.getInstance();
calendar_GST_18_June_2011.setTimeInMillis(System.currentTimeMillis());
calendar_GST_18_June_2011.set(2011, 5, 18, mHour, mMinute, 0);
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar_GST_18_June_2011.getTimeInMillis(), pendingIntentOfTwoMonth);
// for the GST 17 August 2011
Calendar calendar_GST_17_August_2011 = Calendar.getInstance();
calendar_GST_17_August_2011.setTimeInMillis(System.currentTimeMillis());
calendar_GST_17_August_2011.set(2011, 7, 17, mHour, mMinute, 0);
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar_GST_17_August_2011.getTimeInMillis(), pendingIntentOfTwoMonth);
// for the GST 19 October 2011
Calendar calendar_GST_19_October_2011 = Calendar.getInstance();
calendar_GST_19_October_2011.setTimeInMillis(System.currentTimeMillis());
calendar_GST_19_October_2011.set(2011, 9, 19, mHour, mMinute, 0);
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar_GST_19_October_2011.getTimeInMillis(), pendingIntentOfTwoMonth);
// for the GST 17 December 2011
Calendar calendar_GST_17_December_2011 = Calendar.getInstance();
calendar_GST_17_December_2011.setTimeInMillis(System.currentTimeMillis());
calendar_GST_17_December_2011.set(2011, 11, 17, mHour, mMinute, 0);
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar_GST_17_December_2011.getTimeInMillis(), pendingIntentOfTwoMonth);
// for the GST 18 February 2012
Calendar calendar_GST_18_February_2012 = Calendar.getInstance();
calendar_GST_18_February_2012.setTimeInMillis(System.currentTimeMillis());
calendar_GST_18_February_2012.set(2012, 1, 18, mHour, mMinute, 0);
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar_GST_18_February_2012.getTimeInMillis(), pendingIntentOfTwoMonth);
// for the GST 27 April 2012
Calendar calendar_GST_27_April_2012 = Calendar.getInstance();
calendar_GST_27_April_2012.setTimeInMillis(System.currentTimeMillis());
calendar_GST_27_April_2012.set(2011, 3, 27, mHour, mMinute, 0);
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar_GST_27_April_2012.getTimeInMillis(), pendingIntentOfTwoMonth);
Спасибо.