https://kotlinlang.org logo
#android
Title
# android
s

Sudhir Singh Khanger

06/07/2021, 4:20 AM
What is the effect using
NonCancellable
in the following case? Would it outlive the scope and finish the job?
Copy code
viewModelScope.launch {
    withContext(NonCancellable + <http://Dispatchers.IO|Dispatchers.IO>) {
         // some job
    }
}
g

gildor

06/07/2021, 4:44 AM
Yes, it would
s

Sudhir Singh Khanger

06/07/2021, 5:06 AM
Thanks
2 Views