Koin how to inject outside of Android activity / appcompatactivity
问题 Koin is a new, lightweight library for DI and can be used in Android as well as in standalone kotlin apps. Usually you inject dependencies like this: class SplashScreenActivity : Activity() { val sampleClass : SampleClass by inject() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) } } with the inject() method. But what about injecting stuff in places where Activity context is not available i.e. outside of an Activity ? 回答1: There is the KoinComponent