Navigating with arguments
Passing data between destinations is very vital in Android development. The new Jetpack navigation allows developers to attach data to a navigation operation by defining an argument for a destination. Readers will learn how to pass data between destinations using arguments.
A good use case is, say, you load an API with data and want to show more description on the data you just displayed; you can navigate with unique arguments to the next screen.
Getting ready
We will explore the most common interview project requirement, which is to fetch data from an API and display one screen and add an additional screen for extra points.
Let’s assume the API is the GitHub API, and you want to display all organizations. Then, you want to navigate to another screen and see the number of repositories each company has.
How to do it…
For this recipe, we will look at an example of navigating with arguments as a concept since there is little more...