‫Hello, everyone.
‫After we've created our navigation graph, we need to move to the second part, which is the navigation
‫Host Fragment Navigation Host fragment provides an area within your layout for self contained navigation
‫to occur.
‫NAV Host.
‫A fragment is intended to be used as con at the content area within a layout resource defining your
‫app's chrome around it.
‫Each nav host fragment has a nav controller that defines valid navigation within the navigation host.
‫Don't worry, we will talk about controllers in the next videos.
‫This includes the nav graph as well as a navigation state such as current location and backstack that
‫will be saved and restored along with the nav host fragment itself.
‫Back to Android studio.
‫If we notice here, if we open the nav underscore graph that no nav host fragment found.
‫We need to make a layout as or fragment as a host.
‫We go to the main activity.
‫We go to the code here and I can go to the split mode.
‫And first I will add the layout for data binding.
‫Cut from here and paste pasting here.
‫Now I will cut this namespaces.
‫And.
‫Paste it.
‫Paste them here.
‫Okay.
‫I will go to the design mode.
‫I will remove this text view and here I will search for NAV.
‫Host nav you can see nav host fragment.
‫It's very simple.
‫I've searched here for NAV.
‫Or you can go to the containers and find NAV host fragment.
‫Now drag and drop it here inside your.
‫Layout and Android studio will set it for this.
‫Click.
‫Okay.
‫And here we go.
‫This is our container.
‫I will click infer the constraints.
‫Button if I go to split mode?
‫Now, if we go to the split mode, we can see that this is a special fragment and it's name as nav host
‫and default nav host equal to true.
‫If we go back to the nav underscore graph, you can see that the hosts are displayed here.
‫Activity underscore main.
‫Okay, so congratulations guys.
‫We've created the navigation graph.