Relative Content

Tag Archive for androiddagger-2

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?