반응형
interface를 Inject하려고 했을 때 발생했던 문제로, 생성자로 건네받아 해결하는 방법이 있었으나 추가적으로 KoinComponent를 상속받도록 만들어주어 해결하였다.
참고자료
Koin how to inject outside of Android activity / appcompatactivity
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() { ...
stackoverflow.com
Koin by inject() 를 Activity가 아닌 클래스에서 사용하기
https://stackoverflow.com/questions/49629377/koin-how-to-inject-outside-of-android-activity-appcompa...
blog.naver.com
반응형
댓글