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
- WebView
- studio
- error
- Retrofit
- 유튜브
- ADB
- DI
- cursor
- MVVM
- 안스
- 안드로이드 스튜디오
- build
- Kotlin
- 스튜디오
- RecyclerView
- 웹뷰
- Gradle
- 의존성주입
- 에러
- hilt
- 코루틴
- compose
- DAGGER
- coroutine
- 안드로이드스튜디오
- 안드로이드
- Android
- 깃헙
- 코틀린
- Github
Archives
- Today
- Total
목록activityViewModel (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