Sometimes when I try to use the camera, while activity starts, I get a black screen for a while and then appears the follow errors: camera_focusdone: AutoFocus error, camera_ready: java.lang.RuntimeException: Fail to connect to camera service.
Here is an example of the errors:
Here is an example of the errors:
B4X:
cameraexclass_startpreview (java line: 601)
java.lang.RuntimeException: startPreview failed
at android.hardware.Camera.startPreview(Native Method)
at anywheresoftware.b4a.objects.CameraW.StartPreview(CameraW.java:177)
at efa.avansys.ultracable.ventas.cameraexclass._startpreview(cameraexclass.java:601)
at efa.avansys.ultracable.ventas.tomarfoto._cameraevent_ready(tomarfoto.java:405)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:834)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:792)
at efa.avansys.ultracable.ventas.cameraexclass._camera_ready(cameraexclass.java:128)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.CameraW$2$1.run(CameraW.java:139)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3824)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: startPreview failed
** Activity (tomarfoto) Pause, UserClosed = true **
** Activity (documentos) Resume **
sending message to waiting queue (smtp_messagesent)
** Activity (documentos) Pause, UserClosed = true **
** Activity (ventanaregistrarservicios) Resume **
** Activity (ventanaregistrarservicios) Pause, UserClosed = false **
** Activity (tomarfirma) Create, isFirst = true **
** Activity (tomarfirma) Resume **
** Activity (tomarfirma) Pause, UserClosed = true **
** Activity (ventanaregistrarservicios) Resume **
** Activity (ventanaregistrarservicios) Pause, UserClosed = false **
** Activity (documentos) Create, isFirst = false **
** Activity (documentos) Resume **
** Activity (documentos) Pause, UserClosed = false **
** Activity (tomarfoto) Create, isFirst = false **
cameraexclass_release (java line: 457)
java.lang.NullPointerException
at efa.avansys.ultracable.ventas.cameraexclass._release(cameraexclass.java:457)
at efa.avansys.ultracable.ventas.tomarfoto._btnok_click(tomarfoto.java:337)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:63)
at android.view.View.performClick(View.java:2485)
at android.view.View$PerformClick.run(View.java:9080)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3824)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
at dalvik.system.NativeStart.main(Native Method)
java.lang.NullPointerException