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
- CollapsingToolbarLayout
- HTTP
- sqlite
- Behavior
- lifecycle
- activity
- onMeasure
- View
- 알림
- 백준
- room
- kotlin
- 안드로이드
- Algorithm
- notification
- BOJ
- CustomView
- 알고리즘
- DataBinding
- ViewModel
- hilt
- 코틀린
- Coroutine
- CoordinatorLayout
- recyclerview
- onLayout
- Android
- Navigation
- AppBarLayout
- LiveData
Archives
- Today
- Total
목록viewModelScope (1)
개발일지
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/y0ZSV/btq0Q7SWs9A/lET0sSndiK5RTSIwpXXw7K/img.png)
ViewModelScope ViewModel마다 존재하는 Scope이다. ViewModel이 삭제되면 자동으로 취소된다. class ExampleViewModel : ViewModel() { init { viewModelScope.launch { /* ViewModel이 사라지면 종료된다. */ } } } LifeCycleScope LifeCycle 객체마다 존재하는 Scope이다. Create, Start, Resume 3가지의 Mode를 지원하고 Active상태(화면에 보이는 상태)일 때만 수행된다. class CoroutineFragment : BaseFragment(R.layout.fragment_coroutine) { private var count = 0 private val logList b..
Android (안드로이드)/Lifecycle
2021. 3. 24. 10:50