apply some of the changes suggested by natario1

pull/59/merge^2
Tim H 7 years ago
parent 8a16835560
commit 122a2cb174
  1. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java
  2. 13
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java

@ -138,8 +138,8 @@ abstract class CameraController implements CameraPreview.SurfaceCallback {
LOG.i("Stop immediately. Stopped. State is:", ss()); LOG.i("Stop immediately. Stopped. State is:", ss());
} catch (Exception e) { } catch (Exception e) {
// Do nothing. // Do nothing.
LOG.i("Stop immediately. Exception while stopping.", e);
mState = STATE_STOPPED; mState = STATE_STOPPED;
mCameraCallbacks.onError("Stop immediately. Exception while stopping.", e);
} }
} }

@ -1569,10 +1569,15 @@ public class CameraView extends FrameLayout {
LOG.e(message, cause); LOG.e(message, cause);
// redirect // redirect
CameraException cameraException = new CameraException(message, cause); final CameraException cameraException = new CameraException(message, cause);
for (CameraListener listener : mListeners) { mUiHandler.post(new Runnable() {
listener.onError(cameraException); @Override
} public void run() {
for (CameraListener listener : mListeners) {
listener.onError(cameraException);
}
}
});
} }
} }

Loading…
Cancel
Save