public void refreshAllActions() { try { List<RecurringAction> actions = getActiveActions(); recreateAppointments(actions); } catch (SQLException e) { e.printStackTrace(); } finally { databaseHelper.close(); } }
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(); }
public void refreshAction(RecurringAction action) { List<RecurringAction> actionList = new LinkedList<>(); actionList.add(action); recreateAppointments(actionList); databaseHelper.close(); }