What you provided is not a menu layout, but a navigation graph. These are not related things. You need to ceate a my_menu_name.xml file with <menu> and <item> elements. Then, inside Fragment class, you have to implement a MenuProvider like explained here: https://stackoverflow.com/a/71965674/1860868