diff --git a/android/uhabits-core/src/main/java/org/isoron/uhabits/core/commands/ResetHabitsCommand.java b/android/uhabits-core/src/main/java/org/isoron/uhabits/core/commands/ResetHabitsCommand.java index e3c5cfe16..2e226a882 100644 --- a/android/uhabits-core/src/main/java/org/isoron/uhabits/core/commands/ResetHabitsCommand.java +++ b/android/uhabits-core/src/main/java/org/isoron/uhabits/core/commands/ResetHabitsCommand.java @@ -45,8 +45,13 @@ public class ResetHabitsCommand extends Command habitList.update(selected); } else { for (Habit h : habitList) { - h.getRepetitions().removeAll(); - habitList.update(h); + RepetitionList repetitionList = h.getRepetitions(); + Repetition rep; + while(repetitionList.getTotalCount() != 0) { + rep = repetitionList.getOldest(); + repetitionList.toggle(rep.getTimestamp()); + repetitionList.remove(rep); + } } } }