Closed amazingvoice closed 2 years ago
When updating the Injection file, the code segment shown in the codelab is written as:
object Injection { private fun provideGithubRepository(context: Context): GithubRepository { return GithubRepository(GithubService.create(), RepoDatabase.getInstance(context)) } fun provideViewModelFactory(context: Context): ViewModelProvider.Factory { return ViewModelFactory(provideGithubRepository(context)) } }
However the constructor of ViewModelFactory needs 2 parameters. The parameter SavedStateRegistryOwner is missing.
SavedStateRegistryOwner
This has been fixed in the current iteration of the codelab.
When updating the Injection file, the code segment shown in the codelab is written as:
However the constructor of ViewModelFactory needs 2 parameters. The parameter
SavedStateRegistryOwner
is missing.