コード例 #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();
 }