E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.shanky.qrscanner, PID: 8249
java.lang.IllegalStateException: Camera already started!
at github.nisrulz.qreader.QREader.startCameraView(QREader.java:213)
at github.nisrulz.qreader.QREader.start(QREader.java:176)
at github.nisrulz.qreader.QREader$2.onGlobalLayout(QREader.java:118)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:981)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2414)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7098)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
at android.view.Choreographer.doCallbacks(Choreographer.java:702)
at android.view.Choreographer.doFrame(Choreographer.java:638)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
This happens when application goes in paused state while scanning qr code and just resume the application it will crash
This is the code for paused state and resume state
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.shanky.qrscanner, PID: 8249 java.lang.IllegalStateException: Camera already started! at github.nisrulz.qreader.QREader.startCameraView(QREader.java:213) at github.nisrulz.qreader.QREader.start(QREader.java:176) at github.nisrulz.qreader.QREader$2.onGlobalLayout(QREader.java:118) at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:981) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2414) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7098) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927) at android.view.Choreographer.doCallbacks(Choreographer.java:702) at android.view.Choreographer.doFrame(Choreographer.java:638) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6682) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
This happens when application goes in paused state while scanning qr code and just resume the application it will crash
This is the code for paused state and resume state
@Override protected void onPause() { super.onPause();