Closed garik-sargis closed 8 years ago
Here is the article where I explain it: http://fernandocejas.com/2015/04/11/tasting-dagger-2-on-android/
activity()
in ActivityComponent
is for exposing activities to sub graphs:
@PerActivity
@Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class)
public interface ActivityComponent {
//Exposed to sub-graphs.
Activity activity();
}
@yshrsmz even though that, I'm not providing any activity as far as I remember, when I need a context, there is a provider for it.
The
ActivityModule.activity()
method doesn't conform to the provider-method naming convention. Is this on purpose? Isn'tprovideActivity()
a better name?