clone items in the adapter, do not use the object itself

This commit is contained in:
tibbi
2018-03-28 22:56:25 +02:00
parent a20e1ce8f9
commit d4de429898
2 changed files with 3 additions and 1 deletions

View File

@ -48,7 +48,8 @@ class StopwatchAdapter(activity: SimpleActivity, var laps: ArrayList<Lap>, recyc
fun updateItems(newItems: ArrayList<Lap>) { fun updateItems(newItems: ArrayList<Lap>) {
lastLapId = 0 lastLapId = 0
laps = newItems laps = newItems.clone() as ArrayList<Lap>
laps.sort()
notifyDataSetChanged() notifyDataSetChanged()
finishActMode() finishActMode()
} }

View File

@ -177,6 +177,7 @@ class StopwatchFragment : Fragment() {
lapTicks = 0 lapTicks = 0
laps.clear() laps.clear()
updateIcons() updateIcons()
stopwatchAdapter.updateItems(laps)
view.apply { view.apply {
stopwatch_reset.beGone() stopwatch_reset.beGone()