I want to use both Conductor and Kodein in my application. The problem is that both the application context and the activity are null on the Controller setup and I can't access Kodein instance.
class SetupNavigationController: Controller(), KodeinAware {
override val kodein: Kodein by closestKodein(applicationContext!!)
// val kodein = (activity as MainActivity).kodein
val someInstance: SomeClass by kodein.instance()
}
Kodein is lazy by default especially because the applicationContext is null at the time of class instanciation and set later by the system.
You need to use the lazy syntax, so that
applicationContext
will only be accessed when needded: