Code example for OrientationEventListener

Methods: enable

0
            @Override 
            public void onOrientationChanged(int orientation) {
                initOrientation(); 
            } 
        }; 
        sqOrientationListener.enable();
        initOrientation(); 
    } 
 
    /** 
     * Change the view size when the device Orientation is changed 
     */ 
    public void initOrientation() { 
        // Set the position of the Top left View 
        if (leftView && sqTopLeftView != null) sqTopLeftView.updateViewParameter();
 
        // Set the position of the Bottom left View 
        if (leftBottomView && sqBottomLeftView != null) sqBottomLeftView.updateViewParameter();
 
        // Set the position of the Top Right View 
        if (rightView && sqTopRightView != null) sqTopRightView.updateViewParameter();