-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screen
s are not paused when app is in the background or when in another Activity
#225
Comments
Lifecycles are currently directly tied to the screen's Lifecycle, its not tied to the parent Lifecycle yet. That was something I commented on when I improved the Lifecycle integration in #96. |
I see. But that seems to have been added in rc04. This was working as expected in rc05, but it is not working in rc07. The sample above works in rc05, and it pauses in the background and when moving to another Activity Edit: Just tested, and it is not working as expected in rc06, so it was something between rc05 and rc06. |
thank you for adding this! had to downgrade for now to support observing the parent lifecycle |
Jetbrains is working on bringing Lifecycle APIs to iOS/KMP, as for now, the recommendation I would give you is to create a expect/actual function for collectWithLifecycle. |
In
1.0.0-rc07
, theScreen
s seem to not pause, for example when we put the app in the background, or when we are in anotherActivity
.Each
Screen
will only pause when we move to another screen.With this sample code:
And the dependencies:
When we:
RESUMED
when app is in the backgroundWhen we:
RESUMED
when its Activity is actually pausedWhen we:
0 started LaunchedEffect
.If we rollback to
1.0.0-rc05
, with the same sample code, the Screen is paused when we put the app in the background, or when we move to another Activity. TheLaunchedEffect
themselves are not cancelled, but therepeatOnLifecycle
works as expected (they restart when we enter theScreen
that is being shown to the user)The text was updated successfully, but these errors were encountered: