12
Fragment Navigation

In this chapter, you will get the list and the detail parts of CriminalIntent working together. When a user presses an item in the list of crimes, MainActivity will swap out CrimeListFragment with a new instance of CrimeFragment. CrimeFragment will display the details for the crime that was pressed (Figure 12.1).

Figure 12.1  Swapping CrimeListFragment for CrimeFragment

Swapping CrimeListFragment for CrimeFragment

To get this working you will learn how to implement navigation by having the hosting activity change out fragments in response to user actions. You will also learn how to pass data to a fragment instance using fragment arguments. Finally, you will learn how to use LiveData transformations to load immutable data in response to UI changes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.251.22