title: Zoom Control in Camera is not working in Android
body: <p>I am working on Custom Camera using Surface view in my application, also recording Video with screen Capture.</p>
  
  <p>I am looking to implement Zoom Control in my Camera Code but not getting success.</p>
  
  <p>Getting this log while Zooming: </p>
  
  <pre><code>E/Adreno200-ES20(12756): &lt;qgl2DrvAPI_glBufferSubData:709&gt;: GL_INVALID_OPERATION
  </code></pre>
  
  <p>I am using below code:</p>
  
  <p>/**
   * setZoomControl
   * @param params
   */</p>
  
  <pre><code>public void setZoomControl(Camera.Parameters params) {
      paramtrs = params;
      ZoomControls zoomControls = (ZoomControls) findViewById(R.id.zoomcontrols);
  
      if (params.isZoomSupported()) {
          final int maxZoomLevel = paramtrs.getMaxZoom();
          Log.i("max ZOOM ", "is " + maxZoomLevel);
  
          zoomControls.setIsZoomInEnabled(true);
          zoomControls.setIsZoomOutEnabled(true);
  
          zoomControls.setOnZoomInClickListener(new OnClickListener() {
              public void onClick(View v) {
                  int currentZoomLevel = 0;
                  if (currentZoomLevel &lt; maxZoomLevel) {
                      currentZoomLevel++;
                      camera.startSmoothZoom(currentZoomLevel);
                  }
              }
          });
  
          zoomControls.setOnZoomOutClickListener(new OnClickListener() {
              public void onClick(View v) {
                  int currentZoomLevel = 0;
                  if (currentZoomLevel &gt; 0) {
                      currentZoomLevel--;
                      camera.startSmoothZoom(currentZoomLevel);
                  }
              }
          });
      } else
          zoomControls.setVisibility(View.GONE);
  }
  </code></pre>
  
  <p>Please suggest me whats happening in my code.</p>