codelab-android-datastore
codelab-android-datastore copied to clipboard
Adjust DataStore param in UserPreferencesRepository
On the Working with Preferences DataStore codelab section 6. Persisting data in Preferences DataStore, there is the following snippet of code:
class UserPreferencesRepository(
private val userPreferencesStore: DataStore<UserPreferences>,
context: Context
) { ... }
I guess the generics type should be Preferences
and not UserPreferences
. Otherwise, it gives a type mismatch error when trying to instantiate the UserPreferencesRepository
Yes should be like :
class UserPreferencesRepository(
private val userPreferencesStore: DataStore<Preferences>,
context: Context
) { ... }
Thank you, fix is underway. Issue can be tracked in #45