Closed Domi04151309 closed 2 years ago
Do you maybe have a tutorial for Android preferences?
Sure! You can use PreferenceManager.getDefaultSharedPreferences(context)
to get the default SharedPreferences
that cotains set
methods. To edit preferences you have to use the [edit()
](https://developer.android.com/reference/android/content/SharedPreferences#edit()) method. You can then make changes and use [apply()
](https://developer.android.com/reference/android/content/SharedPreferences.Editor#apply()) when you're done.
But it may not be the best solution because it is mainly focused on key value pairs.
Thank you, I will take a look at it.
It might make more sense to use Android preferences for storing data instead of a custom implementation. In case the custom implementation should be kept I suggest using a singleton for that instead of passing the configuration over the activity intents.