반응형
fun startCoroutine() = CoroutineScope(Dispatchers.Main).launch {
//runBlocking도 가능하지만 지양
val job = async(start = CoroutineStart.LAZY) { Jobb() }
Log.d("startCoroutine", "TAG")
job.await()
}
...
// 코루틴
suspend fun Jobb() = CoroutineScope(Dispatchers.Main).launch {
...
#async
#lazy
#suspend fun
반응형
'IT > Android' 카테고리의 다른 글
Kotlin] 안드로이드 채팅방 날짜 표시 (0) | 2021.05.01 |
---|---|
Android] 다른 액티비티에서 프라그먼트 교체 / 뷰페이저 (0) | 2021.04.29 |
Kotlin] 안드로이드 키보드 검색 (0) | 2021.03.23 |
Kotlin] 안드로이드 버튼 눌린 상태로 유지 (0) | 2021.03.23 |
Kotlin] 안드로이드 이미지 공유하기 // Android share image (0) | 2021.03.21 |
댓글