prevent multiple refreshes due to time of day alarm
This commit is contained in:
parent
d1ef7f63ff
commit
71a7f09d41
|
@ -588,7 +588,7 @@ public class UserPreferences {
|
||||||
Calendar alarm = (Calendar)now.clone();
|
Calendar alarm = (Calendar)now.clone();
|
||||||
alarm.set(Calendar.HOUR_OF_DAY, hoursOfDay);
|
alarm.set(Calendar.HOUR_OF_DAY, hoursOfDay);
|
||||||
alarm.set(Calendar.MINUTE, minute);
|
alarm.set(Calendar.MINUTE, minute);
|
||||||
if(alarm.before(now)) {
|
if (alarm.before(now) || alarm.equals(now)) {
|
||||||
alarm.add(Calendar.DATE, 1);
|
alarm.add(Calendar.DATE, 1);
|
||||||
}
|
}
|
||||||
Log.d(TAG, "Alarm set for: " + alarm.toString() + " : " + alarm.getTimeInMillis());
|
Log.d(TAG, "Alarm set for: " + alarm.toString() + " : " + alarm.getTimeInMillis());
|
||||||
|
|
Loading…
Reference in New Issue