I have a MainActivity which injects Presenter, presenter object injects interactor and interactor object injects APIHelper. All the providers of presenter, interactor and APIHel
Change MainPresenterImpl
& ListingInteractorImpl
constructors to following and precede them with @Inject
:
@Inject
public MainPresenterImpl(MainActivity activity, ListingInteractor interactor) {...}
@Inject
public ListingInteractorImpl(Context context, APIHelper helper) {...}
Then in your module implementation:
@Provides
@Singleton
public MainViewPresenter providesMainPresenter(ListingInteractor interactor){
return new MainPresenterImpl(activity, interactor);
}
@Provides
@Singleton
ListingInteractor providesInteractor(APIHelper helper){
return new ListingInteractorImpl(activity, helper);
}