Code example for SurfaceView

Methods: setVisibility

0
        if (camera != null) {
            supportedPreviewSizes = mCamera.getParameters().getSupportedPreviewSizes();
            requestLayout();
        } 
 
        surfaceView.setVisibility(View.VISIBLE);
        previewing = true;
    } 
 
    public void hideSurfaceView() { 
        mCamera = null;
        surfaceView.setVisibility(View.INVISIBLE);
        previewing = false;
    } 
 
    public void surfaceCreated(SurfaceHolder holder) {
        // The Surface has been created, acquire the camera and tell it where 
        // to draw. 
        try { 
            if (mCamera != null) {
                mCamera.setPreviewDisplay(holder);