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

Passing Data Back to CrimeFragment

To give CrimeFragment access to the photo, you are going to pass the filename back from CrimeCameraFragment. Figure 20.5 shows the sequence of events between CrimeFragment and CrimeCameraFragment.

Figure 20.5  CrimeCameraActivity sets a result and an extra

CrimeCameraActivity sets a result and an extra

First, CrimeFragment will start CrimeCameraActivity for a result. When a picture is taken, CrimeCameraFragment will create an intent with the filename as an extra and call setResult(…). The ActivityManager will forward the intent to CrimePagerActivity in onActivityResult(…). CrimePagerActivity’s FragmentManager will then forward the intent to CrimeFragment

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