Spotted a bug? Have a great idea? Help us improve developer profiles! Submit feedback Google Developer Profile Send feedback Return to pathway How do you enable your project to use navigation components? Use the NavigationController class as the launch activity. Make sure every Activity class extends the class NavigationActivity. Add dependencies for navigation-fragment-ktx and navigation-ui-ktx in the build.gradle (module) file. Add to the Android manifest file. Where are the possible routes through your app defined? In the android-manifest.xml file in the element. In a file (often called navigation.xml) in the res > layout folder. In a file (often called navigation.xml) in the res > navigation folder. In a file (often called navigation.xml) in the app > navigation folder. Where do you set the ID of a fragment to be used in navigation? Set the ID variable in the relevant Fragment class. You need to set the ID in both the navigation file for the app and the layout file for the fragment. In the project's navigation file, either by setting the ID attribute in the navigation graph or in the navigation XML file in the res > navigation folder. In the fragment's layout file, either by setting the ID attribute in the design editor or in the layout XML file in the res > layout folder. Where do you define the items for a menu? In the layout file for the fragment or activity that displays the menu, add a tag that contains tags for each item. It depends on where the menu will be shown. For a navigation drawer menu, add an tag for each menu item in the menu.xml file in the res > drawer folder. For the options menu, add an tag for each menu item in the menu.xml file in the res > options folder. In a menu_name.xml file in the res > menu folder, add an tag for each menu item. Create separate XML files for each separate menu. In the android_manifest.xml file, add a tag that contains a tag for each menu, that in turn contains an tag for each menu item. Submit answers error_outline An error occurred when grading the quiz. Please try again.