I have set one alarm in repeated mode for every 24 hours. So Alarm receiver should be call on the time set only once but it calls repeatedly. Why?
Here is I am attached my code to set alarm:
AlarmManager alarmMgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
Intent objIntent = new Intent(this, PedometerAlarmReciever.class);
PendingIntent alarmIntent = PendingIntent.getBroadcast(this, 0, objIntent, 0);
// Set the alarm to start at 21:32 PM
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.HOUR, 11);
calendar.set(Calendar.MINUTE, 20);
calendar.set(Calendar.AM_PM, Calendar.AM);
// setRepeating() lets you specify a precise custom interval--in this case,
// 1 day
alarmMgr.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
AlarmManager.INTERVAL_DAY, alarmIntent);