Using the new (in 2.10) dagger.android classes, I\'m trying to inject things using a Subcomponent that depends on other Modules, and, therefore, has a Builder with setters f
that does work, but it's unnecessary. the seedInstance method provides the activity instance into the graph, so you can have MyActivityModule with no state, and just request MyActivity in your @Provides methods.
class MyActivityModule {
@Provides
static SomethingDerivedFromMyActivity providesMethod(MyActivity myActivity) {
return myActivity.somethingDerived();
}
}
Doing this saves the module instance and allows the generated factories to be leaner.
from https://github.com/google/dagger/issues/615.