How to return failed task result in continuation task?

前端 未结 1 1826
独厮守ぢ
独厮守ぢ 2021-01-27 13:43

I am using Google\'s Task API in Kotlin and am faced with the next situation:

...
val deleteTask = getItem(id)?.continueWithTask { task ->
    if (task.isSucce         


        
相关标签:
1条回答
  • 2021-01-27 13:46

    Ok, I just found what I've been looking for: Tasks API has a Tasks object which has functions: forCanceled() & forResult(). Before I only investigated the Task class and didn't know of the Tasks object... For more information, see here.

    0 讨论(0)
提交回复
热议问题