Skip to content

Instantly share code, notes, and snippets.

@skydoves
Last active March 15, 2018 15:05
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 skydoves/adc82a9f14d516b8e04b9a24761ef641 to your computer and use it in GitHub Desktop.
Save skydoves/adc82a9f14d516b8e04b9a24761ef641 to your computer and use it in GitHub Desktop.
InjectionExampleMainActivity
@Inject lateinit var viewModelFactory: AppViewModelFactory
private val viewModel by lazy { ViewModelProviders.of(this, viewModelFactory).get(MainActivityViewModel::class.java) }
override fun onCreate(savedInstanceState: Bundle?) {
AndroidInjection.inject(this)
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment