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
- Kotlin
- Coroutines
- Gradle
- androidStudio
- Compose
- pandas
- architecture
- 코드포스
- MyVoca
- ProGuard
- TEST
- MiTweet
- textfield
- AWS
- 암호학
- Codeforces
- android
- 쿠링
- Coroutine
- 프로그래머스
- livedata
- Rxjava
- 코루틴
- relay
- boj
- activity
- Hilt
- GitHub
- 백준
- Python
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