Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 웹뷰
- viewpager
- 코틀린
- 스튜디오
- Kotlin
- 코루틴
- build
- Retrofit
- Gradle
- 레트로핏
- 에러
- 안드로이드 스튜디오
- 안스
- WebView
- 유튜브
- Android
- Github
- ADB
- 안드로이드스튜디오
- MVVM
- 깃헙
- studio
- dart
- coroutine
- GIT
- 의존성주입
- error
- image
- RecyclerView
- 안드로이드
Archives
- Today
- Total
목록Dependency Injection (1)
코딩하는 일용직 노동자

안드로이드 의존성주입에 Koin을 사용할때 Activity 와 그 아래 속한 하나 이상의 Fragment 에서 같은 ViewModel 을 사용할 필요가 있는 경우가 있습니다. 기존에는 by sharedViewModel() 을 이용하면 됐는데 이것이 deprecated 되었습니다. 이제는 by activityViewModel() 을 이용하도록 변경되었습니다. val weatherAppModule = module { // WeatherViewModel declaration for Weather View components viewModel { WeatherViewModel(get(), get()) } } class WeatherActivity : AppCompatActivity() { /* * Declare..
안드로이드
2023. 5. 10. 10:03