Navigation

Create a fragment, define navigation paths, and start an external activity. Complete the AndroidTrivia app, which is a game in which users answer trivia questions about Android development and can share their results if they win.

 

Create a fragment

Codelab

Import the starter code for the AndroidTrivia app. Then, create a new fragment and include it in the layout file.

Define navigation paths

Codelab

Add navigation components to the AndroidTrivia app by creating a NavHostFragment, then add fragments to the navigation graph. Change the back button behavior, add up button functionality in the app, add an options menu, and add a navigation drawer.

Start an external activity

Codelab

Update the AndroidTrivia app to allow users to share results with friends through other apps. Set up the Safe Args plugin, add and pass arguments between fragment destinations, and use an implicit intent for the share menu item.

Navigation quiz

Test your knowledge of navigating in an app and navigating to an external activity to earn your Navigation badge.