I tried to use the new coroutines module and launch a job in onAttachView() via TiCoroutineScope.launchUntilViewDetaches {}, but got an exception that the view is not attached.
Due to the check if (!hasLifecycleMethodBeenCalled) return@addLifecycleObserver, to not call things twice, the required Job was indeed not initialized, yet.
Now we avoid the second lifecycle call instead. Practically this means we initialize everything beforeonAttachView() is called and not after.
I tried to use the new coroutines module and launch a job in
onAttachView()
viaTiCoroutineScope.launchUntilViewDetaches {}
, but got an exception that the view is not attached.Due to the check
if (!hasLifecycleMethodBeenCalled) return@addLifecycleObserver
, to not call things twice, the requiredJob
was indeed not initialized, yet.Now we avoid the second lifecycle call instead. Practically this means we initialize everything before
onAttachView()
is called and not after.