I have set up a FrameLayout to be the preview screen for my camera and it works great.
private void fireUpCamera() {
mCamera = getCameraInstance(); // Create an instance of Camera
// Create our Preview view and set it as the content of our activity.
mPreview = new CameraPreview(this, mCamera);// Create our Preview view.
FrameLayout preview = (FrameLayout) findViewById(R.id.quest_image);
preview.addView(mPreview);
}
how do I release this preview and camera in my cancel button without taking the picture?
If you want to remove the mPreview
view from the FrameLayout
named preview
you could simply remove the view from the layout like this:
preview.removeView(mPreview);