I have a project where I have a mix of hosted destinations (screens) and dialog destinations (dialogs) in Compose nav graph.
Sample nav graph:
NavHost(
navController = navController,
startDestination = "PostListScreen",
) {
composable("PostListScreen") { PostListScreen() }
dialog("EditPostDialog") { EditPostDialog() }
dialog("SelectPhotosDialog") { SelectPhotosDialog() }
composable("CameraScreen") { CameraScreen() }
}
I am navigating to EditPostDialog
from PostListScreen
, and then to CameraScreen
. This pops EditPostDialog
from nav stack so when I navigate back from CameraScreen
with some image, EditPostDialog
is gone.
Is there a way to have both dialog and hosted destinations in nav stack so this issue does not occur. I know this is expected behavior as per docs but I have different requirements in project.
Note: I have tried hosting dialog within normal hosted destination but that does not work as well.