Code example for IOException

Methods: getMessage

0
            mCamera.setParameters(p);
            mCamera.setPreviewCallbackWithBuffer(this);
            mCamera.setPreviewDisplay(holder);
            mCamera.startPreview();
        } catch (IOException e) {
            Log.d(TAG, "Error setting camera preview: " + e.getMessage());
        } 
    } 
 
    public void surfaceDestroyed(SurfaceHolder holder) {
        // empty. Take care of releasing the Camera preview in your activity. 
    } 
 
    public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
        // If your preview can change or rotate, take care of those events here. 
        // Make sure to stop the preview before resizing or reformatting it. 
 
        if (mHolder.getSurface() == null){
          // preview surface does not exist 
          return; 
        }