Naviagtion XYZ cant be found from current destination()

23 Views Asked by At

I often get this error a lot in all my projects

Navigation action/destination com.speakerbooster.volumebass.equalizersound.amplifier:id/action_premiumFragment_to_dashboardFragment cannot be found from the current destination Destination(com.speakerbooster.volumebass.equalizersound.amplifier:id/autoCleanerFragment) label=fragment_auto_cleaner class=com.iobits.tech.volumebooster.presentation.fragments.AutoCleanerFragment

Thats how i using navigations to navigate

if (findNavController().currentDestination?.id == R.id.currentFragment) {
                   navigateTo(someactionId)

}

and here is the navigateTo() function

fun Fragment.navigateTo(actionId: Int, destinationName: Int) {
    findNavController().navigate(
        actionId,
        null,
        NavOptions.Builder().setPopUpTo(destinationName, true).build()
    )
}
0

There are 0 best solutions below