TC51 enable/disable barcode scanner by activity or fragment

M Martin Stephenson 3 years 7 months ago
83 0 0

I have created an EMDK wrapper which is created as a singleton of the App.  The idea being to show the splash screen as the app starts and connection to the barcode reader is established.
This works fine and the barcode reader is enabled for the entire app and triggered using the HARD button on the device.
 
I have some Activities (or fragments) which do not support barcode scanning and would like to disable the scanner and remove the listener.
I have called Scanner.disable, which works fine, unfortunately when I re-enable it I have to call BarcodeManager.getDevice() which causes a lag of a second or so - which is why I initialised the scanner at application startup.
 
Is there a way to enable/disable the scanner without a lag ?
 
Thanks.

CONTACT
Can’t find what you’re looking for?