Lesson 6: App 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.

Quiz

Earn your badge for completing Lesson 6: App navigation.