예제 #1
0
 public void refreshAllActions() {
   try {
     List<RecurringAction> actions = getActiveActions();
     recreateAppointments(actions);
   } catch (SQLException e) {
     e.printStackTrace();
   } finally {
     databaseHelper.close();
   }
 }
예제 #2
0
  public void recreateAppointments(List<RecurringAction> actions) {
    Date startDate = getStartDate();
    Date endDate = getEndDate(startDate, OUTLOOK_DAYS);
    int nrOfAppointments = 0;
    for (RecurringAction recurringAction : actions) {
      removeOldAppointments(recurringAction);
      nrOfAppointments += createAppointmentsForTimeSpan(recurringAction, startDate, endDate);
    }

    notifyUser(nrOfAppointments);

    databaseHelper.close();
  }
예제 #3
0
 public void refreshAction(RecurringAction action) {
   List<RecurringAction> actionList = new LinkedList<>();
   actionList.add(action);
   recreateAppointments(actionList);
   databaseHelper.close();
 }