FragmentContainerView using findNavController

后端 未结 3 1606
日久生厌
日久生厌 2020-12-08 05:01

I\'m using Android Navigation Component with bottom navigation, lint gives a warning about replacing the tag with FragmentContainerView

3条回答
  •  醉梦人生
    2020-12-08 05:29

    On top of the accepted answer, a little shortcut what could be used is:

    supportFragmentManager.findFragmentById(R.id.navHostMain)?.findNavController()
    

    Regards

提交回复
热议问题