I'm trying to create a flashcards app in Kotlin but I'm not sure how to make the flashcards I create save after exiting.
val flashCards = FlashCardList(50)
flashCards.addCard(inputTerm.text.toString(),inputDefinition.text.toString(),false)
This above code creates a list of Flashcards (size 50) with term and definition and then adds to it. How would I make this save even after exiting? My understanding from searching is to use sharedpreferences but even after reading some explanations I don't really understand how I would use that here. If someone could turn my above code into one that uses sharedpreferences (or any form of saving variables) I could try to understand what's going on from that.
(This is another post on this forum that I read but couldn't understand in case someone else tries to link it: save variables after quitting application?)