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