private void rotationChanged() {
        // Confirm that it did actually change
        if (isActive() && getDisplayRotation() != openedOrientation) {
            pause();
            resume();
        }
    }
Initialize from XML attributes.

@param attrs the attributes
zxing-android-embedded/src/com/journeyapps/barcodescanner/CameraPreview.java