Closed roostaamir closed 7 years ago
This is not readily available. But should be possible. You can try overriding void onBarcodeDetected(final Barcode barcode)
if you are using SINGLE_AUTO
mode, and comment out the mCameraSource.stop()
line. Or you can try calling void initiateCamera()
after the dialog is closed.
instead of changing your code, I used reflection to call initiateCamera
method and it worked for me. Thank you
instead of changing your code, I used reflection to call
initiateCamera
method and it worked for me. Thank you
exactly.I did the same. Method initiateCam = BarcodeCaptureFragment.class.getDeclaredMethod("initiateCamera"); initiateCam.setAccessible(true); initiateCam.invoke(fragment);
Hi and thank you for your great library I am using the
BarcodeCaptureFragment
to initiate a scan session. I want to initiate the scan session on activity create (therefore I am adding the fragment to the activity in theonCreate
method), and then when a barcode has been scanned, show the user a dialog, and when the user clicks the button on the dialog (I set thesetCancelable
to false), the dialog should be dismissed and the barcode scanning process should begin againWhat I have done so for is this:
The problem is that when a barcode is scanned, the dialog will be shown, and the camera will freeze and will not scan anything else unless I close the activity and open it again I could remove the fragment and add it again, but this does not seem to be a good approach Any suggestions on how I can do this?