Code example for OrientationEventListener

Methods: enable

0
                        mLastLatchedOrientation = latchedOrientation;
                    } 
                } 
            } 
        }; 
        mOrientationListener.enable();
        setFocusable(true);
        requestFocus();
    } 
 
    public void surfaceCreated(SurfaceHolder holder) {
        // The Surface has been created, acquire the camera and tell it where 
        // to draw. 
        mCamera = Camera.open();
        try { 
           mCamera.setPreviewDisplay(holder);
        } catch (IOException exception) {
            mCamera.release();
            mCamera = null;
            // TODO: add more exception handling logic here 
        }