Hi All, please help me to understand when view ge...
# compose-android
p
Hi All, please help me to understand when view gets unloaded from the app in compose ? I want to fire an event when screen gets unloaded. Expectation is like fragments - FragA (screen started) -> move to -> FragB (screen started but FragA not destroyed as its live in background ) -> back to FragA (FragB should call unload event).
s
If you want to know when a navigation event happens like this, your best bet is probably registering a listener here https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigati[…]gedListener&sq=&ss=androidx%2Fplatform%2Fframeworks%2Fsupport to your NavController.
1
And I just realized you posted this in another channel too. https://kotlinlang.slack.com/archives/CJLTWPH7S/p1721808538218219 This is why you must not do that, since conversations then get split and you get double answers and people get half answers reading these threads