"camEx.Release" line written at the Sub Activity_Pause gives an error when the app is closed when the camera is open. How can I solve this? My codes are;
Code:
Sub Activity_Pause (UserClosed As Boolean)
camEx.Release <------ LINE 451
End Sub
And the error is;
Installing file.
PackageAdded: package:app.taksim.driver
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
90
[Height=720, IsInitialized=false, Width=960
]
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
0
[Height=720, IsInitialized=false, Width=960
]
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
Error occurred on line: 451 (Main)
java.lang.RuntimeException: Class instance was not initialized (cameraexclass)
at anywheresoftware.b4a.debug.Debug.shouldDelegate(Debug.java:249)
at app.taksim.driver.cameraexclass._release(cameraexclass.java:72)
at app.taksim.driver.main._activity_pause(main.java:754)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:702)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:336)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at app.taksim.driver.main.onPause(main.java:262)
at android.app.Activity.performPause(Activity.java:5555)
at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1239)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3364)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3333)
at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3311)
at android.app.ActivityThread.access$1100(ActivityThread.java:175)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1319)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5602)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)