public void stopCamera() {
   if (camera != null) {
     preview.stopCameraPreview();
     preview.setCamera(null, null);
     camera.release();
     camera = null;
   }
 }
예제 #2
0
 @Override
 public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
   if (surfaceHolder.getSurface() == null) {
     return;
   }
   stopCameraPreview();
   showCameraPreview();
 }
예제 #3
0
 @Override
 public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
   mSurfaceCreated = false;
   stopCameraPreview();
 }