I am having issue with the new Android Navigation Architecture component when I try to navigate from one Fragment to another, I get this weird error:
A Ridiculous way but very powerful is: Simply call this:
view?.findNavController()?.navigateSafe(action)
Just Create this Extention:
fun NavController.navigateSafe(
navDirections: NavDirections? = null
) {
try {
navDirections?.let {
this.navigate(navDirections)
}
}
catch (e:Exception)
{
e.printStackTrace()
}
}