architecture-components-samples
architecture-components-samples copied to clipboard
navigating using Deeplink not work in NavigationAdvancedSample sample
version navigation component: 2.4.0-alpha02 I try to use deeplink to navigate to UserProfile fragment. But the app crashed and this is the stack trace logcat.
Navigation destination that matches request NavDeepLinkRequest{ uri=www.example.com/user/person } cannot be found in the navigation graph NavGraph(com.example.android.navigationadvancedsample:id/nav_graph) startDestination={NavGraph(com.example.android.navigationadvancedsample:id/home) startDestination={Destination(com.example.android.navigationadvancedsample:id/titleScreen) label=Home class=com.example.android.navigationadvancedsample.homescreen.Title}}
this is my code:
holder.item.findNavController().navigate(Uri.parse("www.example.com/user/${ myDataset[position]}"))
val encodedUrl = URLEncoder.encode("www.example.com/user/${ myDataset[position]}", StandardCharsets.UTF_8.toString())
holder.item.findNavController().navigate("rootPathBlah/$encodedUrl")