Trying to Store EditText Values in SharedPrefs using a Single addTextChangedListener
I'm not sure if what I write below is what you are looking for.  Also I don't know much about Android, so maybe that would not work for some reason.

preserveText(field1, "autoSave")
preserveText(field2, "autoSave2")

val sharedPref: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)

fun preserveText(field: Type????, itemName: String) {
    field.setText(sharedPref.getString(itemName, ""))
    field.addTextChangedListener(object : TextWatcher {
        override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { }

        override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { }

        override fun afterTextChanged(s: Editable) {
            sharedPref.edit().putString(itemName, s.toString()).apply()
        }
    })
}