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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.