INNER CODE UNIT · Kotlin
onInactive
M66B/FairEmail · app/src/main/java/androidx/lifecycle/CoroutineLiveData.kt:237
override fun onInactive() {
super.onInactive()
blockRunner?.cancel()
}
}
/**
* Builds a LiveData that has values yielded from the given [block] that executes on a
* [LiveDataScope].
*
* The [block] starts executing when the returned [LiveData] becomes [active](LiveData.onActive). If
* the [LiveData] becomes [inactive](LiveData.onInactive) while the [block] is executing, it will be
* cancelled after [timeoutInMs] milliseconds unless the [LiveData] becomes active again before that
* timeout (to gracefully handle cases like Activity rotation). Any value [LiveDataScope.emit]ed
* from a cancelled [block] will be ignored.
*
* After a cancellation, if the [LiveData] becomes active again, the [block] will be re-executed
* from the beginning. If you would like to continue the operations based on where it was stopped