am testing my app for process death `Don't keep ac...
# compose
m
am testing my app for process death
Don't keep activities
is turned on and am using
Navigation Component
when I navigate to dialog composable that is registered inside
NavGraph
with
dialog() {}
it’s not on top after I leave app and come back how can I make it be on top after process death? is there a way for
Navigation Component
to do that or I need to keep track of that and navigate to
dialog
destination after app is restored?
i
You should file a bug if you can reproduce it in a sample app; Navigation certainly recreates your dialog after process death and recreation, same as with any other destination.
m
thanks Ian, I will recreate bug and file it
a
@Marko Novakovic please post here link to that bug if you already filed it. I encountered same problem a few days ago but I’ve been too busy to investigate more. https://kotlinlang.slack.com/archives/CJLTWPH7S/p1636538825234000
👍 1
m
I have project for reproduction and bug is reproducable
a
thanks 👍
i
You can't use
AlertDialog
inside a
dialog
destination, that doesn't make any sense at all. A
dialog
destination puts the content of your composable in its own managed
Dialog
instance
The
dialog
documentation specifically points this out and specifically points out that you shouldn't use a
dialog
destination for
AlertDialog
(instead, just show that
AlertDialog
directly): https://developer.android.com/reference/kotlin/androidx/navigation/compose/package-summary#(androidx.navigation.NavGra[…]roperties,kotlin.Function1)
I suspect if you just have your
TextButton
directly in the
dialog
destination, you'll find that you just get the single
dialog
managed
Dialog
with your content
m
I used just
TextButton
but it still works the same, it’s not on the top when I come back from process death
i added this to the issue