コード例 #1
0
 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();
 }