Rohil Chodankar
08/08/2019, 9:56 AMMarko Mitic
08/08/2019, 10:20 AMMarko Mitic
08/08/2019, 10:21 AMMarko Mitic
08/08/2019, 10:24 AMclass MyActivity: Activity(), KoinComponent {
override fun getKoin(): Koin = sdk.koin //sdk is one of your instances
Rohil Chodankar
08/08/2019, 10:26 AMritesh
08/08/2019, 10:27 AMinstance1
and instance2
. And we do override, getKoin(), we have a check there, if current sdk is using whicn config, and based on that we give the koin instance.
Problem is it always overrides the second instance.Rohil Chodankar
08/08/2019, 10:31 AMclass ABC {
internal lateinit var localInstance: KoinApplication
fun init(
configuration : Configuration
): SDKInstance {
val modules: List<Module> = koinModules + module(configuration)
localInstance = koinApplication {
androidContext(context)
modules(modules)
}
Rohil Chodankar
08/08/2019, 10:31 AMRohil Chodankar
08/08/2019, 10:32 AMMarko Mitic
08/08/2019, 10:34 AMritesh
08/08/2019, 10:37 AM1
or 2
@Marko MiticMarko Mitic
08/08/2019, 10:37 AMMarko Mitic
08/08/2019, 10:37 AMritesh
08/08/2019, 10:37 AMritesh
08/08/2019, 10:38 AMRohil Chodankar
08/08/2019, 10:42 AMmodule {
single {
Configuration(name)
}
}
Rohil Chodankar
08/08/2019, 10:42 AMMarko Mitic
08/08/2019, 10:55 AMRohil Chodankar
08/08/2019, 10:57 AMMarko Mitic
08/08/2019, 10:58 AMRohil Chodankar
08/08/2019, 11:00 AMclass MyActivity: Activity(), KoinComponent {
override fun getKoin(): Koin = sdk.koin //sdk is one of your instances
Rohil Chodankar
08/08/2019, 11:00 AMritesh
08/08/2019, 11:40 AMritesh
08/08/2019, 11:41 AMritesh
08/08/2019, 11:41 AMritesh
08/08/2019, 11:44 AMval sdk1 = CustomSdk.initDI(firstConfig)
val sdk2 = CustomSdk.initDI(secondConfig)
It will create two koin instances.
Now, based on flag, it should take from the respective cotainer. But, it sdk2
overrides sdk1
. If activity is started from sdk1
@Marko Mitic @arnaud.giulianiRohil Chodankar
08/09/2019, 6:55 AM