Моя реализация:
AndroidManifest.xml:
Код: Выделить всё
...
Код: Выделить всё
MainActivity.onCreate().setContent{}Код: Выделить всё
val rootUri = "https://www.xkcd.com"
NavHost(navController = navController, startDestination = "mainView") {
composable("mainView", deepLinks = listOf(navDeepLink { uriPattern = rootUri })) {
MainContent()
}
composable(
route = "singleView/{number}",
arguments = listOf(navArgument("number") { type = NavType.IntType }),
deepLinks = listOf(navDeepLink { uriPattern = "$rootUri/{number}" })
) { backStackEntry ->
val number = backStackEntry.arguments?.getInt("number")
SingleView(number)
}
}
Подробнее здесь: https://stackoverflow.com/questions/697 ... ck-compose