Hello, I noticed that if i dont use scanner for a while (until Android goes to sleep and locks it's screen) the scanner stops working. After i wake up the device my application cannot scan any more. I use Android EMDK. How can i restart the scanner after app returns from sleeping?
Barcode scanner stops working after some time of inactivity |
3 Replies
[deleted]
For what is worth it does not happen if device is connected in USB debugging mode. If app works stand alone (not attached to a debugger) then this happens.
Hi, yes on newer devices the scanner will sleep when the device sleeps as a power saving feature. The recommended approach is to disable the scanner during onPause() and reenable it during onResume (see the sample at samples-emdkforandroid-6_6/MainActivity.java at BarcodeSample1 · Zebra/samples-emdkforandroid-6_6 · GitHub )