Code example for Camera

Methods: setPreviewTexture

0
    // no-op 
  } 
 
  @Override 
  public void attach(Camera camera) throws IOException {
    camera.setPreviewTexture(surface);
  } 
 
  @Override 
  public void attach(MediaRecorder recorder) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
      // no-op 
    } 
    else { 
      throw new IllegalStateException(
                                      "Cannot use TextureView with MediaRecorder"); 
    } 
  } 
 
  @Override 
  public View getWidget() {