fun putString(key: String, value: String?) { prefs?.edit()?.putString(key, value)?.apply() }
// Example for androidutility.v165 object PrefUtils { private var prefs: SharedPreferences? = null
fun init(context: Context, name: String = "app_prefs") { prefs = context.getSharedPreferences(name, Context.MODE_PRIVATE) }
fun putString(key: String, value: String?) { prefs?.edit()?.putString(key, value)?.apply() }
// Example for androidutility.v165 object PrefUtils { private var prefs: SharedPreferences? = null androidutility.v165
fun init(context: Context, name: String = "app_prefs") { prefs = context.getSharedPreferences(name, Context.MODE_PRIVATE) } fun putString(key: String, value: String