onDestroy

fun onDestroy()

Critical to place inside your navigation activity so that when your application gets destroyed the navigation service unbinds and gets destroyed, preventing any memory leaks. Calling this also removes all listeners that have been attached.