https://kotlinlang.org logo
#compose
Title
# compose
p

pawegio

03/08/2021, 8:37 AM
BackHandler
seems to not intercept system back presses on
AppCompatActivity
restart in my case (in nested
NavHost
composables). Is it a known issue? 🤔
a

Adam Powell

03/08/2021, 2:48 PM
Not that I've heard so far. Please file an issue on the tracker with a repro case if you can isolate it
p

pawegio

03/10/2021, 9:33 AM
i

Ian Lake

03/10/2021, 7:25 PM
Do you still see this issue after upgrading to Activity Compose 1.3.0-alpha04? There was a fix to
BackHandler
in today's release. https://developer.android.com/jetpack/androidx/releases/activity#1.3.0-alpha04
p

pawegio

03/10/2021, 9:24 PM
@Ian Lake Unfortunately, it’s still an issue in the newest version. 😕 The only workaround for me is to invalidate navigation on lifecycle restart (recreate back stack and navigate to current route using back stack entries). Then it works, but it’s quite ugly.
i

Ian Lake

03/10/2021, 9:35 PM
Thanks for confirming, we'll take a look
👍 1
2 Views