<How to keep a Mutable List with the previous data...
# stackoverflow
r
How to keep a Mutable List with the previous data added in a view Model class in Kotlin? I have two classes: one is the viewModel (ShoesViewMode.ktl) to keep the data and the other is the Fragment to show the data.(ShoesList.kt ) ShoesList has a mutableList of words and I recover it from the ShoesList to show in a scrollview. I get a new word from an EditText from a Fragment -> Click on Save button -> Pass this word through nave Args to ShoesDetails -> save it in the ShoesViewModel -> Recover it and show in the Fragment. The problem is that every time I add a new word, the list...