-
Notifications
You must be signed in to change notification settings - Fork 0
Dagger β Injecting values at runtime by creating module
Devrath edited this page Oct 6, 2023
·
5 revisions
Contents |
---|
Observations |
Output |
Code |
- In projects sometimes we might need to pass the values dynamically, This means when we are creating the components(activity .. etc.) and not when dagger generates the code.
- So appropriate variable as placeholders has to be set during the generation stage itself so that we can pass values for those variables.
- In the output you can see that we had passed the dynamic value 20 from
activity
when the activity is being constructed.
WatchBattery constructor is invoked !
Watch class constructor is invoked !
buildWatch method in watch class is invoked with capacity 20
Contents |
---|
implementations |
Modules |
Components |
Activity |