In my project I have a simple Navigation Graph, **addOnDestinationChangedListener ** working fine but after the code click **addOnDestinationChangedListener ** is not trigger but navigation action did execute
CoroutineScope(Dispatchers.IO).launch {
kotlin.runCatching { Constants.getBitmapFromView(binding.frameLayout) }.onSuccess {
kotlin.runCatching {
mBitmap = it
findNavController().navigate(R.id.previewFragment)
}
}
}
If i change the clickListener to navigate then its working fine,but i need to trigger
navController.addOnDestinationChangedListener { _, destination, _ ->
}