由于绘制了Roccoon,我找到了解决方案:
fun Job.status(): String = when {
isActive -> "Active/Completing"
isCompleted && isCancelled -> "Cancelled"
isCancelled -> "Cancelling"
isCompleted -> "Completed"
else -> "New"
}
此链接中的更多信息:https : //kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-job/
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句