konmik / nucleus

Nucleus is an Android library, which utilizes the Model-View-Presenter pattern to properly connect background tasks with visual parts of an application.
MIT License
1.98k stars 253 forks source link

Context in presenter for Dagger 2 dependency injection #123

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi, Actually it is first time to use both nucleus and dagger 2, so, I just stucked in how to inject objects in presenter while I don have a context to be casted to the application class which has the dagger components that has the ability to inject objects and it is not good to provide and access a static application context, so can you please help me clarifying this.

konmik commented 7 years ago

https://github.com/konmik/nucleus/blob/master/nucleus-example-real-life/src/main/java/nucleus/example/ui/base/BaseFragment.java#L18