Skip to content

Instantly share code, notes, and snippets.

@Stashevskiy
Created November 13, 2020 15:04
fun Fragment.parentSafeNavigate(currentDestination: Int, navDirections: NavDirections){
if(parentFragment?.findNavController()?.currentDestination?.id == currentDestination){
parentFragment?.findNavController()?.navigate(navDirections)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment