public void stopCamera() {
   if (!flagPreviewInitialized) {
     return;
   }
   if (mCamera != null) {
     mPreview.stopCameraPreview();
     mPreview.setCamera(null, null);
     cameraLayout.removeView(mPreview);
     removeView(cameraLayout);
     cameraLayout = null;
     this.cameraInstanceManager.releaseCamera(mCamera);
   }
   if (mCameraHandlerThread != null) {
     mCameraHandlerThread.quit();
     mCameraHandlerThread = null;
   }
   flagPreviewInitialized = false;
 }
 public void stopCameraPreview() {
   if (mPreview != null) {
     mPreview.stopCameraPreview();
   }
 }