prevent multiple refreshes due to time of day alarm

This commit is contained in:
Tom Hennen 2015-07-26 15:36:25 -04:00
parent d1ef7f63ff
commit 71a7f09d41
1 changed files with 1 additions and 1 deletions

View File

@ -588,7 +588,7 @@ public class UserPreferences {
Calendar alarm = (Calendar)now.clone();
alarm.set(Calendar.HOUR_OF_DAY, hoursOfDay);
alarm.set(Calendar.MINUTE, minute);
if(alarm.before(now)) {
if (alarm.before(now) || alarm.equals(now)) {
alarm.add(Calendar.DATE, 1);
}
Log.d(TAG, "Alarm set for: " + alarm.toString() + " : " + alarm.getTimeInMillis());