Read this article about how to implement Navigation inside Android Application
Please Note that you need the Beta build of Android Studio which supports Navigation Editor to use this project.
Navigation Architecture Component is a tool created by Google to make it easier for developers to work on Android projects, it works with the following rules:
- Only one Activity lives in the Application, all the other screens are
Fragments
- Main Activity includes the navigation component, every fragment and actions (parameters) are configured in the res/navigation/nav_graph.xml file (open with Navigation Editor on Android Studio v3.3).
- xml elements are available for navigation actions:
action
: Navigate to a new Fragment, contains anid
and adestination
argument
: Argument to pass to a new Fragment, containts aname
and adefaultValue
Please refer to the documentation.
You may also want to check this video for insights on how to create new fragments, link fragments together (navigate between each other), everything that we need to know is explained in this video.
Test Fragment is only here for navigation demonstration, it will be deleted very soon.