How To Rebind The Module At Secound Time Called In Kodein?
I have an android app, its developed in kotlin, also we use kodein dependence for binding the data.When the binding the data first time it will bind correctly but it does not bind
Solution 1:
When you call kodein.instance() you get an instance of your binding and because your binding type is singleton: you get same instance as previous and just one time it will create, not any more, so InitializingCurrentAddressProvider(keyStore, instance(), instance(), applicationContext,i) just called once. switch singleton to provider to see calling InitializingCurrentAddressProvider(keyStore, instance(), instance(), applicationContext,i) every time you get instance(), InitializingCurrentAddressProvider(keyStore, instance(), instance(), applicationContext,i) executed.
Post a Comment for "How To Rebind The Module At Secound Time Called In Kodein?"