Open singla-harshul opened 2 months ago
While navigating from one screen to another, the onPause and onStop lifecycle events of the previous screen are not being called.
yes, I can also repeat it.
Facing same issue as well. @adrielcafe @DevNatan Is there any fix for this issue? I'm seeing this was closed as one of the fix PR had got merged: https://github.com/adrielcafe/voyager/issues/42
We are still facing the issue in 1.1.0-beta2
I’m also facing the same issue.
Is there any fix for this ?
I'm using this way to listen to lifecycle event.
val lifecycleOwner = LocalLifecycleOwner.current
DisposableEffect(lifecycleOwner) {
val observer = LifecycleEventObserver { _, event ->
// Handle event
}
lifecycleOwner.lifecycle.addObserver(observer)
onDispose {
lifecycleOwner.lifecycle.removeObserver(observer)
}
}
I guess the issue here is with lifecycle observer being removed in onDispose
as Screen content is disposed on navigating to new page.
onPause/onStop
events are triggered for that screen, but consuming it this way is not possible. What would be the right way in this case?
While navigating from one screen to another, the onPause and onStop lifecycle events of the previous screen are not being called.