48.7 Adding an Action to the Navigation Graph
Now that the two destinations have been added to the graph and the corresponding user interface layouts designed, the project now needs a way for the user to navigate from the main fragment to the second fragment. This will be achieved by adding an action to the graph which can then be referenced from within the app code.
To establish an action connection with the main fragment as the origin and second fragment as the destination, open the navigation graph and hover the mouse pointer over the vertical center of the right-hand edge of the mainFragment destination so that a circle appears as highlighted in Figure 48-12:
Figure 48-12
Click within the circle and drag the resulting line to the secondFragment destination:
Figure 48-13
Release the line to establish the action connection between the origin and destination at which point the line will change into an arrow as shown in Figure 48-14:
Figure 48-14
An...