Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Fix wrong usage of hasLifecycleMethodBeenCalled in TiCoroutineScope #192

Merged
merged 1 commit into from
Jun 6, 2019

Conversation

Syex
Copy link
Contributor

@Syex Syex commented Jun 6, 2019

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 before onAttachView() is called and not after.

@Syex Syex merged commit 73f64c8 into master Jun 6, 2019
@Syex Syex deleted the fix_coroutine_scope branch June 6, 2019 08:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants