Exemplo n.º 1
0
 @Override
 public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
   if (surfaceHolder.getSurface() == null) {
     return;
   }
   stopCameraPreview();
   showCameraPreview();
 }
Exemplo n.º 2
0
 public void initCameraPreview() {
   if (mCamera != null) {
     getHolder().addCallback(this);
     getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
     getHolder().setFormat(PixelFormat.TRANSLUCENT);
     if (mPreviewing) {
       requestLayout();
     } else {
       showCameraPreview();
     }
   }
 }