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 |
Tags
- onMeasure
- notification
- View
- HTTP
- room
- LiveData
- lifecycle
- CollapsingToolbarLayout
- AppBarLayout
- Coroutine
- Android
- activity
- kotlin
- Algorithm
- CustomView
- sqlite
- 안드로이드
- 백준
- DataBinding
- BOJ
- 알고리즘
- ViewModel
- hilt
- CoordinatorLayout
- onLayout
- recyclerview
- 알림
- Navigation
- 코틀린
- Behavior
Archives
- Today
- Total
목록yield (1)
개발일지
Kotlin in A..Z - Coroutine(3) Cancel
cancel() Job을 취소시키는 함수, Job이 취소되었을 때 suspend 함수를 호출하면 JobCancellationException을 발생시킨다. fun main() = runBlocking { val job = launch { repeat(5) { try { delay(1000L) println("Job Run Index($it)") } catch (e: Exception) { e.printStackTrace() } } } delay(3000L) job.cancel() job.join() } Job Run Index(0) Job Run Index(1) kotlinx.coroutines.JobCancellationException: StandaloneCoroutine was cancelled; ..
Kotlin (코틀린)
2020. 10. 15. 22:05