Join Slack
Powered by
Is there a recommended approach to using SharedPre...
# android
d
Damien O'Reilly
04/13/2019, 10:04 AM
Is there a recommended approach to using SharedPreferences when dealing with MVVM and LiveData?
google
3
stackoverflow
5
s
Sam
04/13/2019, 3:22 PM
Its yet another data source, abstract it out to repository
👍 3
Sam
04/13/2019, 3:22 PM
https://android.jlelse.eu/android-observe-shared-preferences-as-livedata-27e25e7d3172
d
Damien O'Reilly
04/14/2019, 11:45 AM
Thanks for your direction Vairavan
g
Geert
04/15/2019, 10:00 AM
Nice solution, I just added a companion object in MainActivy and initialised it in the onCreate method
3
Views
Open in Slack
Previous
Next