Fatal Exception: java.lang.RuntimeException: Camera is being used after Camera.release() was called at android.hardware.Camera._stopPreview(Camera.java) at android.hardware.Camera.stopPreview(Camera.java:884) at com.uuzuche.lib_zxing.activity.CaptureFragment.surfaceDestroyed(CaptureFragment.java:186) at android.view.SurfaceView.updateWindow(SurfaceView.java:688) at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:285) at android.view.View.dispatchWindowVisibilityChanged(View.java:10511) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1779) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1472) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7003) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:912) at android.view.Choreographer.doCallbacks(Choreographer.java:714) at android.view.Choreographer.doFrame(Choreographer.java:646) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:898) at android.os.Handler.handleCallback(Handler.java:836) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6337) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1084) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:945)
Every once in a while. I get the following error
Fatal Exception: java.lang.RuntimeException: Camera is being used after Camera.release() was called at android.hardware.Camera._stopPreview(Camera.java) at android.hardware.Camera.stopPreview(Camera.java:884) at com.uuzuche.lib_zxing.activity.CaptureFragment.surfaceDestroyed(CaptureFragment.java:186) at android.view.SurfaceView.updateWindow(SurfaceView.java:688) at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:285) at android.view.View.dispatchWindowVisibilityChanged(View.java:10511) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1315) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1779) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1472) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7003) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:912) at android.view.Choreographer.doCallbacks(Choreographer.java:714) at android.view.Choreographer.doFrame(Choreographer.java:646) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:898) at android.os.Handler.handleCallback(Handler.java:836) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6337) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1084) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:945)