Answer the question
In order to leave comments, you need to log in
How to erase all SharedPreferences?
The cleanup function looks like this, but nothing happens to you. The context here is obtained in the constructor via getApplicationContext()
fun clear() {
val prefs = context.getSharedPreferences("MyAppPrefs", 0)
var editor: SharedPreferences.Editor = prefs.edit()
editor.clear()
editor.putBoolean("clear", true)
editor.apply()
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question