Closed jscti closed 8 months ago
How about trying to use onBackPressedDispatcher.onBackPressed()
(I just googled it, it seems to do what you need to do, I did not need it myself yet)?
You somehow must tell the compose system that you want to emulate a back press so that it can decide which BackHandler
is currently the most inner one that wants to handle a back press... Your code simply ignores the BackHandlers
and tells the navController
to pop the back stack, which it of course will do...
Hey thanks
Got it working like you said, my Scaffold BackButton now triggers a "BackPress" and let BackHandler
s do their job.
val dispatcher = LocalOnBackPressedDispatcherOwner.current?.onBackPressedDispatcher
+
Scaffold onBackButton : dispatcher.onBackPressed()
For the "log" thing, do you think it's possible to "mute" them ? Need a separate issue to close this one ?
Thanks ;)
I removed the last log line, I did only find one though...
Hi There
My SettingScreen is based on a Scaffold with :
navController.popBackStack()
On a "Back" gesture : everything is OK, opened PreferenceSubScreen gets closed first, then my SettingScreen But clicking on my Scaffold Back-button closes directly my SettingScreen without closing the opened PreferenceSubScreen first
Is there a way to fix that ?
Not related but could it be possible to enable/disable the logs of your libs which are quite verbous ^^
Thanks :)