@Override
        public void cameraClosed() {
            for (StateListener listener : stateListeners) {
                listener.cameraClosed();
            }
        }
Add a listener to be notified of changes to the preview state, as well as camera errors.

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