.
While using this effect I observed that if I move to another activity, then the
onDispose
lambda in the
DisposableEffect
of the composable in previous activity I navigated from didn’t get called.
Is this an expected behaviour? That since I didn’t use compose navigation instead activity navigation
onDispose
isn’t called.
And on the same topic can you suggest some other alternative of disposing data when composable moves out of view in case of activity navigation, my usecase is I want to send a tracking event everytime user moves out of screen.
a
Albert Chang
10/15/2021, 10:58 AM
onDispose
is similar to activity's
onDestroy
. Unlike fragments and composables, when you move to a new activity, the previous activity isn't destoryed. It just stops.
👍 2
a
axehit
10/15/2021, 11:23 AM
Ok, got it, then is there some way in composable to know that it has move to background or onPause state analogous API?