title: Android - CameraDevice was already closed
body: <p>I was trying so long for Camera2 api integration to my app. When i switch from portrait mode to landscape it throws exception</p>
  
  <pre><code>    java.lang.IllegalStateException: CameraDevice was already closed
  at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:1984)
  at android.hardware.camera2.impl.CameraDeviceImpl.submitCaptureRequest(CameraDeviceImpl.java:825)
  at android.hardware.camera2.impl.CameraDeviceImpl.setRepeatingRequest(CameraDeviceImpl.java:880)
  at android.hardware.camera2.impl.CameraCaptureSessionImpl.setRepeatingRequest(CameraCaptureSessionImpl.java:231)
  at com.essentialsln.memtalk.ui.fragments.Camera2Fragment$11.onConfigured(Camera2Fragment.java:795)
  at java.lang.reflect.Method.invoke(Native Method)
  at android.hardware.camera2.dispatch.InvokeDispatcher.dispatch(InvokeDispatcher.java:39)
  at android.hardware.camera2.dispatch.HandlerDispatcher$1.run(HandlerDispatcher.java:65)
  at android.os.Handler.handleCallback(Handler.java:739)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at android.os.Looper.loop(Looper.java:148)
  at android.os.HandlerThread.run(HandlerThread.java:61)
  </code></pre>