I found a project on the githaba, which is presented as a benchmark for implementing MVP with Dagger 2. So, to my surprise, there are similar methods in the Activity module:
@Provides @PerActivity MainMvpPresenter<MainMvpView> provideMainPresenter( MainPresenter<MainMvpView> presenter) { return presenter; } And since we are creating the activation component with OnCreate() :
mActivityComponent = DaggerActivityComponent.builder() .activityModule(new ActivityModule(this)) .applicationComponent(((MvpApp) getApplication()).getComponent()) .build(); it turns out that when you turn the screen, the presenter will also die. After all, it is more reasonable to instantiate the presenter of the main activity to bind to the life of the application ? So why is the provider of the presenter located in the activation module?