I understand that when I try to modify (add in that case) the list I got ConcurrentModificationException, but what is the best solution to fix that?
for (Map.Entry<String, Child> entry : children.entrySet() {
childEvent.child = entry.getValue();
if (childEvent.getDate() != null && childEvent.getDate().equals(selectedDate)) {
if(this.selectedDayevents.isEmpty()) {
// List
this.selectedDayevents.add(childEvent);
}
for (CareDay selectedCareDay : this.selectedDayevents) {
// Here I have to combine data in some cases...
}
}
}