My code:
private List<Day> readDays(File file) {
List<Day> days = new ArrayList<>();
try {
ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
days.addAll((List<Day>) in.readObject());
} catch (IOException | ClassNotFoundException e) {
Logger.logError(LOG_TAG, e);
}
return days;
}
Unchecked cast problem in this code
days.addAll((List<Day>) in.readObject());
And this is a problem, in some cases the app crashes.