Pablo
11/04/2020, 1:07 PM@ContributeAndroidInjection
and then if my Activity2 wants to inject Fragment1
Why I need to implement HasAndroidInjector and do the
@Inject lateinit var androidInjector: DispatchingAndroidInjector<Any>
override fun androidInjector(): AndroidInjector<Any> = androidInjector
to be able to use a Fragment that is already with @ContributeAndroidInjection
? If I remove this two lines it says :
RunTimeException:Unable to resume activity {MyActivity}: java.lang.IllegalArgumentException: No injector factory bound for Class<MyClass>I thought that if I have this:
@ContributesAndroidInjector(
modules = [ FragmentProvider::class]
)
fun bindMyActivity2: Activity2
It would work anyways, because I've add as a modules a module that has inside the @ContributesAndroidInjector
with that Fragment...
Is it because I need that `hasAndroidInjector`when I want to provide injection into a inner Fragment?Colton Idle
11/04/2020, 6:40 PM