public ArrayList<Activity> orderActivitiesByTime(ArrayList<Activity> activities, LinkedHashSet<Integer> activityIds) {
		ArrayList<Activity> reorderedActivities = new ArrayList<>();
//		if (activityIds != null) {
			for (int i : activityIds) {
				for (Activity a : activities) {
					if (i == a.getIdActivity()) {
						reorderedActivities.add(a);
						break;
					}
				}
			}
			for (Activity a : activities) {
				if (!reorderedActivities.contains(a)) reorderedActivities.add(a);
			}
//		}
		return reorderedActivities;
	}