본문 바로가기
#FIXME

Koin 사용 중 Inject() 사용 불가 문제

by YEON-DU 2021. 1. 1.
반응형

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

pokerface582님의 블로그 : 네이버 블로그

 

Koin by inject() 를 Activity가 아닌 클래스에서 사용하기

https://stackoverflow.com/questions/49629377/koin-how-to-inject-outside-of-android-activity-appcompa...

blog.naver.com

반응형

댓글