Android Kotlin - Saving Preferences (key value pair) - not working for me
I am trying various simple Android Kotlin examples, to save some persistent data in my app.
To start, I am using a straight forward example of writing one key-value pair, and reading it back.
here's my code, in my activity's OnCreate()
val sharedPrefFile = "MyPrefFile"
val sharedPreferences: SharedPreferences = this.getSharedPreferences(sharedPrefFile, Context.MODE_PRIVATE)
fun setPref()
{
val editor = sharedPreferences.edit()
val myName = "Elvis"...