July 2015
Beginner to intermediate
600 pages
18h 59m
English
The next step is to actually take the picture. This is the easy part: you get to use an implicit intent again.
Start by stashing the location of the photo file. (You will use it a few more times, so this will save a bit of work.)
Listing 16.4 Grabbing photo file location (CrimeFragment.java)
...
private Crime mCrime;
private File mPhotoFile;
private EditText mTitleField;
...
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
UUID crimeId = (UUID) getArguments().getSerializable(ARG_CRIME_ID);
mCrime = CrimeLab.get(getActivity()).getCrime(crimeId);
mPhotoFile = CrimeLab.get(getActivity()).getPhotoFile(mCrime);
}
...
Next you will hook up the camera button ...
Read now
Unlock full access