Skip to content

Instantly share code, notes, and snippets.

@Nimrodda
Last active March 21, 2019 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nimrodda/131d6093a24be74e15dfb377748649e2 to your computer and use it in GitHub Desktop.
Save Nimrodda/131d6093a24be74e15dfb377748649e2 to your computer and use it in GitHub Desktop.
class DetailActivity : AppCompatActivity() {
private val githubApi = GithubApi()
private val viewModel by viewModels { DetailViewModelFactory(githubApi, this) }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Use viewModel here
viewModel.loadData()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment