I have a custom view extending a TextView
. Where should I call my component to inject the view?
component.inject(customTextView);
I have a custom view extending a TextView
. Where should I call my component to inject the view?
component.inject(customTextView);
My general solution for that kind of thing is this
So, I've find out that I need to add the injection in the constructor of my custom view (in all of them, or make one call the other)
Example:
UPDATE: Since 2.10 version of Dagger this answer is invalid.
Custom view:
Activity:
Dagger2 component with Activity scope:
Scope: