Skip to content

Instantly share code, notes, and snippets.

@florina-muntenescu
Created December 6, 2020 20:38
Show Gist options
  • Save florina-muntenescu/07742e4703df51639ba09ade90a643e0 to your computer and use it in GitHub Desktop.
Save florina-muntenescu/07742e4703df51639ba09ade90a643e0 to your computer and use it in GitHub Desktop.
/* Copyright 2020 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
+ private val wordViewModel: WordViewModel by viewModels {
+ WordViewModelFactory(repository)
+ }
override fun onCreate(savedInstanceState: Bundle?) {
- val viewModelFactory = WordViewModelFactory(repository)
- val viewModel = ViewModelProvider(this, viewModelFactory).get(WordViewModel::class.java)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment