Adam Brown
06/25/2023, 9:41 PMBackCallback
didn't do anything, then the back would do nothing, the UI wouldn't go back. is that correct?
private val backCallback = BackCallback { /* do nothing */ }
init
, but I would expect to need to unregister it in a lifecycle callback, is that not needed?onStop
for a component that was getting pushed on top of in a stack. But that doesnt appear to be getting called. Are components lower down in a stack (not active) to be considered "started"?Arkadii Ivanov
06/25/2023, 10:06 PMOnBackPressedDispatcher
.
So you have to update the callback's isEnabled
property according to your state.Adam Brown
06/25/2023, 10:07 PMArkadii Ivanov
06/25/2023, 10:10 PMAdam Brown
06/25/2023, 10:13 PMunregister
ever?Arkadii Ivanov
06/25/2023, 10:24 PMAdam Brown
06/25/2023, 10:25 PMComp A
always fires, but never the backhandler in Comp B
. Maybe the order of operations I'm expecting is different? I would expect a bottom up propagation, so a child could steal the event first.Arkadii Ivanov
06/25/2023, 10:27 PMAdam Brown
06/25/2023, 10:29 PMArkadii Ivanov
06/25/2023, 10:30 PMAdam Brown
06/25/2023, 10:30 PMcomponentContext._childStack()_
Arkadii Ivanov
06/25/2023, 10:39 PMAdam Brown
06/26/2023, 4:04 PM