Capturing an image from POIDetailFragment
We are now ready to take on the task of capturing a photo. This will involve the following tasks:
Adding new user interface widgets to initiate capturing a photo and displaying it
Building a photo intent to navigate to an external camera app to capture a photo
Processing the results of the photo intent and displaying a photo once it is successfully captured
The following sections describe the details of each step.
Adding UI elements
There are a few new UI elements that we will need to add to support capturing an image; we need an ImageButton
element to initiate the process of capturing an image, and we also need an ImageView
element to display the captured POI image. The ImageButton
widget can be added adjacent to the location and map buttons, and the ImageView
element can be placed as the first widget above the Name field.
The following list shows the definition of the ImageView
, which should be placed inside the LinearLayout
before the POI name text field...