Skip to content

Instantly share code, notes, and snippets.

Last active September 3, 2021 09:39
What would you like to do?
fun Fragment.navigate(directions: NavDirections) {
val controller = findNavController()
val currentDestination = (controller.currentDestination as? FragmentNavigator.Destination)?.className
?: (controller.currentDestination as? DialogFragmentNavigator.Destination)?.className
if (currentDestination == {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment