Injecting fragment’s data into viewmodel using dagger2
I have a FooViewModel
that is scoped to the FooFragment
. In FooFragment
, the device type is passed from another fragment based on what user selects. I want to inject this in the constructor of the FooViewModel
. How should I provide the deviceType
in the module?
Injecting fragment’s data into viewmodel using dagger2
I have a FooViewModel
that is scoped to the FooFragment
. In FooFragment
, the device type is passed from another fragment based on what user selects. I want to inject this in the constructor of the FooViewModel
. How should I provide the deviceType
in the module?
Dagger-2 cannot provide a dependency from another module
I’ve run into the fact that I can’t inject a repository into my view model. I have two modules app and data. In I build all dependencies through Application Component