Hi
MikeSW17
I will send you the following version
In this version you after going to OCR_Activity
If you
only [ 1 click ] the
[Start OCR] button and hit the back button for exit activity
Everything is fine and you are back to the previous activity.
But
If you click the
[Start OCR] [2 or more times ] and then try to return to the previous activity, you will encounter the following error.
** Activity (ocr_activity) Create, isFirst = false **
** Activity (ocr_activity) Resume **
** Activity (ocr_activity) Pause, UserClosed = true **
** Activity (main) Resume **
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.camerasource.CameraSource.stop()' on a null object reference
at textrecognitionwrapper.textrecognitionWrapper$1.surfaceDestroyed(textrecognitionWrapper.java:236)
at android.view.SurfaceView.updateWindow(SurfaceView.java:588)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:247)
at android.view.View.dispatchWindowVisibilityChanged(View.java:10514)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1551)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1261)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6345)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:621)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
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:6138)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
This issue became clear after updating my program and crashing high in the program statistics?
Let me know if you solve the problem
Thanks