use of com.alexstyl.specialdates.date.DateAndTime in project Memento-Calendar by alexstyl.
the class DailyReminderScheduler method updateReminderTime.
public void updateReminderTime(TimeOfDay timeOfDay) {
PendingIntent pendingIntent = buildPendingIntent();
DateAndTime dateAndTime = new DateAndTime(Date.Companion.today(), timeOfDay);
TimeOfDay now = TimeOfDay.now();
if (now.isAfter(timeOfDay)) {
// already passed. plan for the next day
dateAndTime = dateAndTime.addDay(1);
}
alarmManager.setExact(AlarmManager.RTC, dateAndTime.toMilis(), pendingIntent);
}
use of com.alexstyl.specialdates.date.DateAndTime in project Memento-Calendar by alexstyl.
the class FacebookFriendsScheduler method scheduleNext.
public void scheduleNext() {
DateAndTime dateAndTime = new DateAndTime(Date.Companion.today().addDay(1), EIGHT_O_CLOCK);
PendingIntent pi = PendingIntent.getService(context, 0, new Intent(context, FacebookFriendsIntentService.class), PendingIntent.FLAG_UPDATE_CURRENT);
alarmManager.setRepeating(AlarmManager.RTC, dateAndTime.toMilis(), AlarmManager.INTERVAL_DAY, pi);
}
Aggregations