navigation-keep-fragment-sample icon indicating copy to clipboard operation
navigation-keep-fragment-sample copied to clipboard

findNavController().currentDestination seems incorrect

Open tatsuyafujisaki opened this issue 4 years ago • 0 comments

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

tatsuyafujisaki avatar May 13 '20 01:05 tatsuyafujisaki