일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- ViewModel
- 알림
- notification
- LiveData
- activity
- Algorithm
- Navigation
- BOJ
- CustomView
- Coroutine
- sqlite
- HTTP
- Android
- lifecycle
- View
- recyclerview
- DataBinding
- kotlin
- 알고리즘
- hilt
- onMeasure
- AppBarLayout
- onLayout
- Behavior
- 안드로이드
- room
- CoordinatorLayout
- CollapsingToolbarLayout
- 백준
- 코틀린
- Today
- Total
목록Dispatchers (2)
개발일지

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..
Gradle 설정 dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7") } Thread vs Coroutine Thread와 Coroutine은 동시성을 보장하기 위한 기술이다. Thread Preempting Scheduling 자원을 서로 차지하려고 노력하고 OS가 Context Switching을 통해 Thread에게 자원을 할당한다 -> Overhead발생 Thread자체 Stack메모리를 가지고 JVM Stack을 차지한다. Coroutine Cooperatively 처리 단위가 Thread가 아닌 Coroutine에서 제공하는 Job Object단위로 하나에 Thread에서 진행된다. Thread..