I have an app built with navigation component. I have a field in my graph which slide up a bottom sheet dialog fragment upon cliking on a filter icon on the toolbar. However, if i double click really fast on the toolbar filter icon or click really fast the toolbar filter icon and any other view which has navigation tied to it, my app crashes with the following error message:
java.lang.IllegalArgumentException: navigation destination com.th3pl4gu3.locky:id/action_Fragment_Card_to_Fragment_View_Card is unknown to this NavController
Below is the code example for my toolbar filter icon.
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.Toolbar_Filter -> {
findNavController().navigate(CardFragmentDirections.actionFragmentCardToBottomSheetFragmentCardFilter())
true
}
else -> false
}
}
Is this a normal behaviour for navigation architecture component?
If not, can you please provide me a fix?