Closed sagar15795 closed 7 years ago
@sagar15795 : Google has depreciated it. Check by clicking on that function.
Yes, that I also know but I don't get the clear reason why is it depreciated and how to remove it? Sorry if it is a silly question because I am a beginner to Dagger 2.
This is deprecated because new updated Dagger 2 can handle it automatically.
So we don't need to add it now
@sagar15795 This deprecation is shown because Dagger2 has found that the ActivityModule do not provide any dependency and is redundant. The application will run the same way even if you remove the module ( i.e. remove this line: .activityModule(new ActivityModule(this))). If you add a provides method in the ActivityModule and inject that dependency somewhere then this deprecation will be removed because then it will be a requirement for DI.
@janishar Thanks for the explanation.
In mainactivity.java
I am getting depreciate error on line no-30 i.e.
.activityModule(new ActivityModule(this))
.If you could explain me why is it happening then it will be helpful?