How to use the new AndroidInjector.inject and still be able to provide an Activity instance inside the activity module? Dagger docs do not make it clear how to do this.
The use case is as follows: I have an activity module that provides the presenter with my activity, but the presenter needs a link to Activity. I used to have something like
@Inject Presenter presenter; public onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((CustomApplication) getApplicationContext()) .getAppComponent() .plus(new ActivityModule(this)); }
Can someone point me to a sample that uses AndroidInjector.inject(this) instead and allow the Activity link inside the Dagger 2 module?
android dagger-2
BugsBunnyBR
source share