Reputation: 303
I am trying to navigate up the backstack. On calling the method view?.findNavController().navigateUp()
and logging the destination using view?.findNavController().getCurrentDestination()
, I see the function popping the current destination and then reloading it again. I don't understand why this could be happening yet I am doing the same in other fragments and it's working.
Upvotes: 2
Views: 1351
Reputation: 303
The issue came up because I was using LiveData to trigger the navigation. To avoid the issue, I have had to update the MutableLiveData before navigating so that it does not request to navigate back when I navigateUp from the destination.
Upvotes: 5