Hello 👋, I was trying to save every title here is my code
. . .
val title = edittext?.text
OnClick
. . .
context.getSharedPreferences(TAG, Context.MODE_PRIVATE).let {
It.edit().putStringSet(TAG, HashSet<String>().also{
It.add(title)
}).apply()
}
. . .
. . .
It saves the title but it also replace the the old with newer(delete all values and add new values) for e.g my first title was foo
When I add another title in edittext and save it
Like "hello world" during retrieving it shows only [hello world] all I want was [foo, hello world]