android / codelab-android-dagger

Apache License 2.0
181 stars 157 forks source link

Mistake in the In the 8. Injecting the graph into an Activity . Private with @Inject #55

Closed YvgenTroshchiy closed 3 years ago

YvgenTroshchiy commented 3 years ago

In the 8. Injecting the graph into an Activity

MainActivity.kt

class MainActivity : AppCompatActivity() {

    // @Inject annotated fields will be provided by Dagger
    @Inject
    private lateinit var userManager: UserManager

    @Inject
    private lateinit var mainViewModel: MainViewModel

    ...
}

but Dagger does not support injection into private fields