[android] Kotlin ArrayList SharedPreferences json data (feat. Gson)
▣ Model data class Person(val name: String, val age: Int) ▣ Read val preferences = getSharedPreferences("pref", Context.MODE_PRIVATE) val jsonData = preferences.getString("person", "") val gson = Gson() val token: TypeToken = object : TypeToken(){} val list: MutableList? = gson.fromJson(jsonData, token.type) ▣ Write val preferences = getSharedPreferences("pref", Context.MODE_PRIVATE) val jsonDat..