Skip to content Skip to sidebar Skip to footer

Android Alarm Working, But Delayed

I'm trying to make a simple alarm clock and everything is working as it should, but I'm finding that the firing of the alarm is delayed. I think the problem may be that the system

Solution 1:

I'd rather comment this but I don't have 50 rep yet so I'll have to submit an answer.

I think the problem is the line

calendar.setTimeInMillis. 

You then set the hour and minute but everything else (seconds and ms) stay exactly as it was when you ran that code.

If you want the alarm to go off at exactly 10:30, set the hours, set the minutes and then reset the seconds and milliseconds to be 0;

Post a Comment for "Android Alarm Working, But Delayed"