Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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