Code example for Camera

Methods: cancelAutoFocus

0
  public void autoFocus() { 
    camera.autoFocus(getHost());
  } 
 
  public void cancelAutoFocus() { 
    camera.cancelAutoFocus();
  } 
 
  // based on CameraPreview.java from ApiDemos 
 
  @Override 
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    final int width=
        resolveSize(getSuggestedMinimumWidth(), widthMeasureSpec);
    final int height=
        resolveSize(getSuggestedMinimumHeight(), heightMeasureSpec);
    setMeasuredDimension(width, height);
 
    if (previewSize == null && camera != null) {
      previewSize=
          getHost().getPreviewSize(getDisplayOrientation(), width,