public void startCamera(int cameraId) { if (mCameraHandlerThread == null) { mCameraHandlerThread = new CameraHandlerThread(this); } Camera camera = cameraInstanceManager.getCamera("back"); mCameraHandlerThread.startCamera(camera); }
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; }