Code example for Camera

Methods: autoFocuscancelAutoFocus

0
    } 
  } 
 
  private void takePicture(final ShutterCallback shutter, final PictureCallback raw,
      final PictureCallback jpeg) {
    mCamera.cancelAutoFocus();
    mCamera.autoFocus(new Camera.AutoFocusCallback() {
      @Override 
      public void onAutoFocus(boolean success, Camera camera) {
        mCamera.takePicture(shutter, raw, jpeg);
      } 
    }); 
  } 
 
  @Override 
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.camera_fragment_layout, container, false);
    mPreview = (Preview) view.findViewById(R.id.cameraPreview);
    mPictureButton = ((Button) view.findViewById(R.id.cameraTakePictureButton));
    mPostButtons = (ViewGroup) view.findViewById(R.id.cameraPostPictureButtons);