You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UserPreferencesRepository class UserPreferencesRepository constructor( private val userPreferencesStore: DataStore<UserPreferences>, context: Context )... data class UserPreferences(val showCompleted: Boolean)
The text was updated successfully, but these errors were encountered:
Problem:
I followed every step mentined in the Codelab tutorial https://developer.android.com/codelabs/android-preferences-datastore?hl=zh-cn#5, but I encountered this problem"Type mismatch. Required: DataStore<UserPreferencesRepository.UserPreferences> Found: DataStore".
TasksActivity
viewModel = ViewModelProvider( this, TasksViewModelFactory( TasksRepository, UserPreferencesRepository(dataStore, this) ) ).get(TasksViewModel::class.java)
UserPreferencesRepository
class UserPreferencesRepository constructor( private val userPreferencesStore: DataStore<UserPreferences>, context: Context )... data class UserPreferences(val showCompleted: Boolean)
The text was updated successfully, but these errors were encountered: