O'Reilly logo

Android Programming: The Big Nerd Ranch Guide by Brian Hardy, Bill Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Showing Larger Image in a DialogFragment

The final step for your camera implementation is to offer users a larger version of the Crime’s photo.

Figure 20.10  A DialogFragment displaying a larger image

A DialogFragment displaying a larger image

Create a new class in the com.bignerdranch.android.criminalintent package. Name the class ImageFragment; make it a subclass of DialogFragment.

ImageFragment will need the filepath of the Crime’s photo in its fragment arguments. In ImageFragment.java, add a newInstance(String) method that accepts a filepath and puts it in the arguments bundle, as shown in Listing 20.18.

Listing 20.18  Create ImageFragment (ImageFragment.java)

p​u​b​l​i​c​ ​c​l​a​s​s​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required