Skip to content

Instantly share code, notes, and snippets.

@AndroidPoet
Created April 17, 2026 17:28
Show Gist options
  • Select an option

  • Save AndroidPoet/076e844418d162f129e6a26cb508963b to your computer and use it in GitHub Desktop.

Select an option

Save AndroidPoet/076e844418d162f129e6a26cb508963b to your computer and use it in GitHub Desktop.
navController.navigate(Route.UserProfile("user123", showPosts = true))
navController.popBackStack()
navController.popBackStack(Route.Home, inclusive = false)
val currentRoute = navController.currentBackStackEntry?.toRoute()
navController.currentBackStackEntryAsState().value?.toRoute()?.let {
Log.d("Navigation", "Current route: $it")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment