navigation-keep-fragment-sample
navigation-keep-fragment-sample copied to clipboard
findNavController().currentDestination seems incorrect
First, thanks for sharing the great navigation sample.
Adding a logger as follows ...
class DashboardFragment : Fragment() {
// ...
override fun onCreateView(...): View? {
Log.d("DashboardFragment", findNavController().currentDestination?.label.toString())
}
// ...
}
... shows the log below.
D/DashboardFragment: NotificationsFragment
The expected behavior is as follows:
D/DashboardFragment: DashboardFragment