heldenssjoerd
Member
We're using cameraexclass version 1.30.
Executing the following shows the taken picture perfect on a panel
The button OK is pressed when you're ok with the given preview.
When it's for some reaseon not ok you can press "oOpnieuw" and then you can see the preview again.
However sometimes when quickly pushing buttons we're getting an error on the startPreview from within the class. See below.
Executing the following shows the taken picture perfect on a panel
B4X:
Sub oOk_Click
Log("Ok")
oOk.Visible = False
oOpnieuw.Enabled=False
oOk.Enabled = False
Panel1.Visible=False
Panel1.Enabled=False
CallSub3(Main,"ShowProgressDialog","Bezig met opslaan...",False)
Panel2.enabled = True
Panel2.Visible = True
camEx.TakePicture
' Sleep(1)
oOpnieuw.Enabled=True
Log("Ok Done")
End Sub
B4X:
Sub oOpnieuw_Click
Log("Opnieuw")
oOk.Enabled=False 'setting other buttons to false so there can't be any action from those.
oOpnieuw.Enabled=False
oImageView.Color = Colors.Black
Panel1.Visible=True
Panel1.Enabled=True
oVorige.Visible = True
oVorige.Enabled = True
Panel2.enabled = False
Panel2.Visible = False
camEx.StartPreview 'fails at this point
oOk.Visible = True
oOk.Enabled = True
Log("OpnieuwDone")
End Sub
The button OK is pressed when you're ok with the given preview.
When it's for some reaseon not ok you can press "oOpnieuw" and then you can see the preview again.
However sometimes when quickly pushing buttons we're getting an error on the startPreview from within the class. See below.
B4X:
java.lang.RuntimeException: startPreview failed
at android.hardware.Camera.startPreview(Native Method)
at anywheresoftware.b4a.objects.CameraW.StartPreview(CameraW.java:177)
at lmmobile.jds.android.cameraexclass._startpreview(cameraexclass.java:1530)
at lmmobile.jds.android.lm_main_foto._oopnieuw_click(lm_main_foto.java:1413)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7252)
at android.view.View.performClickInternal(View.java:7229)
at android.view.View.access$3500(View.java:821)
at android.view.View$PerformClick.run(View.java:27765)
at android.os.Handler.handleCallback(Handler.java:914)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7560)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)