How to properly add options menu on a single fragment with navigation component without broke “up behavior”

后端 未结 2 809
日久生厌
日久生厌 2021-01-13 01:18

I\'m having some trouble to add options menu on a single fragment because it\'s breaking the navigation Up. Here my code

I have an single Activity with NoActio

2条回答
  •  醉话见心
    2021-01-13 01:50

    If you're using setSupportActionBar, you must use setupActionBarWithNavController(), not toolbar.setupWithNavController as per the documentation.

提交回复
热议问题