Why do we need to give default value inside getBoolean() in kotlin?
I'm trying to put some data whose key: "isLoggedIn" and a value: true inside a shared preference file.
I do it this way...
sharedPreferences=getSharedPreferences(getString(R.string.preference_file_name), Context.MODE_PRIVATE)
fun savePreferences(){
sharedPreferences.edit().putBoolean("isLoggedIn",true).apply()
}
and then if I want to retreive/store this key-value pair inside a variable it allows me only when I give the second parameter which is a value or defualt value like this.
val...