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 | 29 | 30 | 31 |
Tags
- Coroutines
- 쿠링
- 코루틴
- Rxjava
- livedata
- Python
- textfield
- Kotlin
- Codeforces
- 암호학
- 코드포스
- architecture
- Gradle
- pandas
- Compose
- MiTweet
- GitHub
- ProGuard
- activity
- boj
- 백준
- relay
- TEST
- AWS
- androidStudio
- 프로그래머스
- Hilt
- Coroutine
- MyVoca
- android
Archives
- Today
- Total
목록viewmodel (1)
이동식 저장소
[Hilt] ViewModels
Hilt는 Jetpack ViewModel을 생성자 주입할 수 있다. 생성자 주입이란 생성자에 ``@Inject`` 키워드를 붙이는 방식이다. @HiltViewModel class MainScreenViewModel @Inject constructor( private val someData: Data ) : ViewModel() { /* ... */} 이제 ``@AndroidEntryPoint`` 어노테이션이 붙은 클래스에서 ViewModel 객체를 얻을 수 있다. ``by viewModels()`` 구문이 많이 사용된다. KTX(KoTlin eXtension) 구문 중 하나이다. 기차 아님. @AndroidEntryPoint class MyActivity : AppCompatActivity() { pr..
Primary/Android
2022. 8. 29. 10:04