While studying the library, dagger2 ran into a problem - I cannot understand how the inject annotation happens and works in this example.
for MainScreenPresenter.java . (an example is extremely simple and if you are familiar with dagger2 and using it in android, then I am sure you will have no difficulty in looking to say what's what)
You can see that the dependency is declared at the constructor level:
@Inject public MainScreenPresenter(Retrofit retrofit, MainScreenContract.View mView) { this.retrofit = retrofit; this.mView = mView; } But in the only place where this class is used, the initiation procedure takes place in a single line.
@Inject MainScreenPresenter mainPresenter; I don’t understand - where does the reference for Retrofit retrofit and MainScreenContract.View mView MainScreenPresenter come from at this place when initializing MainScreenPresenter if they are not advertised anywhere, and there is no connection to the presenter in the components and modules to provide the connection?