我有一個關於Android鬧鐘管理器的問題。 我有以下代碼片段來設置每週應該觸發的警報(一次)。鬧鐘管理器觸發次數過多
// Add the time and set when the notification will be triggered
Calendar setCalendar = item.getDate();
calendar.set(Calendar.MINUTE,setCalendar.get(Calendar.MINUTE)+10080);
//Create a new alarm intent
Intent alarmIntent = new Intent(ApplicationUtils.getApplicationContext(), AlarmReceiver.class);
PendingIntent sender = PendingIntent.getBroadcast(ApplicationUtils.getApplicationContext(), requestCode, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
// Get the AlarmManager service
AlarmManager alarmManager = (AlarmManager) context.getSystemService(context.ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.ELAPSED_REALTIME, sender);
而我不得不面對以下問題。當一週改變時,通知即將到來,他們永遠不會停止。 有沒有人有任何想法如何設置日曆,使警報每週觸發一次?
感謝,Arkde