[Android] Fix UI job cancellation
Geoffrey Métais
git at videolan.org
Mon Sep 17 16:57:16 CEST 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Sep 17 16:54:36 2018 +0200| [7283a4452f31bfce755995930da1bc55a0015acf] | committer: Geoffrey Métais
Fix UI job cancellation
> https://code.videolan.org/videolan/vlc-android/commit/7283a4452f31bfce755995930da1bc55a0015acf
---
tools/src/main/java/org/videolan/tools/KotlinExtensions.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/src/main/java/org/videolan/tools/KotlinExtensions.kt b/tools/src/main/java/org/videolan/tools/KotlinExtensions.kt
index 5fa1d0b94..4f7a0ef38 100644
--- a/tools/src/main/java/org/videolan/tools/KotlinExtensions.kt
+++ b/tools/src/main/java/org/videolan/tools/KotlinExtensions.kt
@@ -8,7 +8,7 @@ import kotlinx.coroutines.experimental.Dispatchers
import kotlinx.coroutines.experimental.Job
import kotlinx.coroutines.experimental.android.Main
-fun LifecycleOwner.createJob(cancelEvent: Lifecycle.Event = Lifecycle.Event.ON_STOP): Job = Job().also { job ->
+fun LifecycleOwner.createJob(cancelEvent: Lifecycle.Event = Lifecycle.Event.ON_DESTROY): Job = Job().also { job ->
lifecycle.addObserver(object : GenericLifecycleObserver {
override fun onStateChanged(source: LifecycleOwner?, event: Lifecycle.Event) {
if (event == cancelEvent) {
More information about the Android
mailing list