I have been forcing myself to use dagger-android
for my new project, in order to reduce all the boiler plate for subComponents for activities and fragments.
But struggling with getting my @UserScope
deps to be injected in those activities.
Reading up dagger-android it seems to support this kind of object graph:
Application -> Activity -> Fragment -> Sub-fragments
In my case I need a UserScope to sit between Application and Activity. i.e
|-> Activity -> Fragment -> Sub-fragments`
Application -> User - |
|-> Activity -> Fragment -> Sub-fragments`
I was wondering if there is way to achieve this WITH using ContributesAndroidInjector
along with a custom subcomponent.
Any advice.
Couple of similar threads: