I want to use dagger library to android library project. I also fallows How to use dagger in a android library project but does not get proper implementation. Anyone has demo or any Ideas about it ? I also want these library classes extends in project for some changes.
Asked
Active
Viewed 680 times
5
-
Can you explain what exactly is not working with your library project? – Eugen Martynov Feb 19 '16 at 15:28
-
I have code like above link given but not cleared that how to use dagger in library project ? – Sachin Feb 20 '16 at 05:46
1 Answers
0
I don't know what the library is, but I would assume most of the code doesn't contain classes with uncontrolled lifecycle (activities, services, fragments, etc.).
If it is true then just use constructors to pass your dependencies.
If it is not then, you have to make a decision who is going to hold knowledge about dependencies graph. A usual solution that context is castable to objects graph knowledge, or it know how to get it. Usually, classes with uncontrolled lifecycle have access to the context

Eugen Martynov
- 19,888
- 10
- 61
- 114