Updating CrimeFragment’s View

Now that the model layer is updated, you can turn to updating the view layer. In particular, CrimeFragment will display a thumbnail-sized photo in an ImageView.

Figure 20.7  CrimeFragment with new ImageView

CrimeFragment with new ImageView

Adding an ImageView

Return to layout/fragment_crime.xml and add the ImageView shown in Figure 20.8.

Figure 20.8  CrimeFragment layout with ImageView (layout/fragment_crime.xml)

CrimeFragment layout with ImageView (layout/fragment_crime.xml)

You also need an ImageView in the landscape layout, as shown in Figure 20.9.

Figure 20.9  Landscape layout with ImageView (layout-land/fragment_crime.xml ...

Get Android Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.