Hi <@UHAJKUSTU>. In my application i’m using the c...
# decompose
b
Hi @Arkadii Ivanov. In my application i’m using the childstack backstack to display or not a back arrow in a top app bar. If i switch of apps and come back, the backstack will be empty but the navbar backbutton will navigate back to the previous screen, which seems odd to me. Shouldn’t the backstack be in sync with the navigation upon restoration or is there something i’m missing ?
a
Hello. Perhaps I'm missing something from your message, but the stack should be restored after process recreation. You can use
backStack.isNotEmpty
to show/hide the back button.
b
Indeed it works. I made a mistake by trying to get the first child instance of the backstack via
̏childstack.backstack?.firstOrNull()?.instance
but i suppose the instance is not restored, only the configuration that allows to create a new instance is. So i should look at the configuration instead of the instance to know exactly which child is in the backstack. Thanks for the pointer, it allowed me to spot my issue !
a
Yes, that's correct. Glad that helped.