I would like to use NavController.OnNavigatedListener to log destinations changing events. The problem is that when some fragment is saved in backstack than for every navigation change is onNavigated
called ones more and destination is that fragment which is saved in backstack. I need to filter this events, but I don't know how. I was trying to find something usefull in destination
but I found nothing.
class MyOnNavigatedListener() : NavController.OnNavigatedListener {
override fun onNavigated(controller: NavController, destination: NavDestination) {
//log events
}
}