I've read that constructor injections don't require a module. So I have this questions.
If I have this constructor injection:
private Model realmModel; @Inject public MainActivityPresenter(Model realmModel) { this.realmModel = realmModel; }
and this component:
@Singleton
@Component(modules = {AppModule.class})
public interface AppComponent {
Model realmModel();
void inject(MainActivity activity);
}
if in my MainActivity I do it:
((MyApp)getApplication()).createAppComponent().inject(this);
how could I pass the realmModel
parameter to the presenter constructor injection?
EDIT: this is the model:
Presenter presenter;
@Inject
public RealmModel(Presenter presenter) {
this.presenter = presenter;
}
Thanks