android - Preview mode must have started before you can take a picture -
we getting such stacktraces in our application using cwac-camera:
java.lang.illegalstateexception: preview mode must have started before can take picture @ com.commonsware.cwac.camera.cameraview.takepicture(cameraview.java:329) @ com.commonsware.cwac.camera.cameraview.takepicture(cameraview.java:277) @ com.github.randoapp.camera.randocamerahost.onautofocus(randocamerahost.java:119) @ com.commonsware.cwac.camera.cameraview.onautofocus(cameraview.java:411) @ android.hardware.camera$eventhandler.handlemessage(camera.java:824) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:4898) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1008) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:775) @ dalvik.system.nativestart.main(native method)
we believe can happenning because of users pressing take picture early. solution disable button while preview initializing , enable when it's done. question is: event use button enabling? there event or callback sayong preview initialized?
we believe can happenning because of users pressing take picture early
that distinct possibility.
what event use button enabling? there event or callback sayong preview initialized?
autofocusavailable()
in camerahost
best option @ moment. called before preview begins , inpreview
set true
.
i have filed an issue better job this.
Comments
Post a Comment