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
- sqlite
- kotlin
- ViewModel
- DataBinding
- Navigation
- room
- CustomView
- lifecycle
- activity
- 안드로이드
- HTTP
- CollapsingToolbarLayout
- Android
- 알고리즘
- 알림
- onLayout
- AppBarLayout
- View
- LiveData
- notification
- BOJ
- onMeasure
- Algorithm
- CoordinatorLayout
- hilt
- recyclerview
- Coroutine
- 코틀린
- Behavior
- 백준
Archives
- Today
- Total
목록Cancel (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