Code example for SurfaceHolder

Methods: addCallbacksetKeepScreenOnsetType

        // setup the surface holder 
        _surfaceHolder = getHolder();
        // register as callback so we get notified when the underlying surface is created, changed, or destroyed (activity gets paused) 
     * This is called after the surface is first created. Acquires the camera and tells it where to draw. 
    public void surfaceCreated(final SurfaceHolder holder) {
//    	Log.d(PhotoCompassApplication.LOG_TAG, "CameraView: surfaceCreated"); 
        _camera =;