Commit 1e3156b6 by Oscar Fuentes

Fix honeywell class

parent 9b7f8c1f
...@@ -42,7 +42,8 @@ public class EDA50K extends BaseScan implements BarcodeListener { ...@@ -42,7 +42,8 @@ public class EDA50K extends BaseScan implements BarcodeListener {
} }
@Override @Override
public void scan(final CordovaInterface cordova, CordovaWebView webView, JSONArray args, final CallbackContext callbackContext) { public void scan(final CordovaInterface cordova, CordovaWebView webView, JSONArray args,
final CallbackContext callbackContext) {
if (manager == null) { if (manager == null) {
AidcManager.create(cordova.getActivity(), new CreatedCallback() { AidcManager.create(cordova.getActivity(), new CreatedCallback() {
...@@ -63,9 +64,11 @@ public class EDA50K extends BaseScan implements BarcodeListener { ...@@ -63,9 +64,11 @@ public class EDA50K extends BaseScan implements BarcodeListener {
// set the trigger mode to auto control // set the trigger mode to auto control
try { try {
barcodeReader.setProperty(BarcodeReader.PROPERTY_TRIGGER_CONTROL_MODE, BarcodeReader.TRIGGER_CONTROL_MODE_AUTO_CONTROL); barcodeReader.setProperty(BarcodeReader.PROPERTY_TRIGGER_CONTROL_MODE,
BarcodeReader.TRIGGER_CONTROL_MODE_AUTO_CONTROL);
} catch (UnsupportedPropertyException e) { } catch (UnsupportedPropertyException e) {
Toast.makeText(cordova.getActivity(), "Failed to apply properties", Toast.LENGTH_SHORT).show(); Toast.makeText(cordova.getActivity(), "Failed to apply properties", Toast.LENGTH_SHORT)
.show();
} }
Map<String, Object> properties = new HashMap<String, Object>(); Map<String, Object> properties = new HashMap<String, Object>();
...@@ -101,8 +104,7 @@ public class EDA50K extends BaseScan implements BarcodeListener { ...@@ -101,8 +104,7 @@ public class EDA50K extends BaseScan implements BarcodeListener {
} }
} }
}); });
} } else {
else {
readBarcode(callbackContext); readBarcode(callbackContext);
} }
} }
...@@ -119,20 +121,17 @@ public class EDA50K extends BaseScan implements BarcodeListener { ...@@ -119,20 +121,17 @@ public class EDA50K extends BaseScan implements BarcodeListener {
@Override @Override
public void onResume(boolean multitasking) { public void onResume(boolean multitasking) {
super.onResume(multitasking);
if (barcodeReader != null) { if (barcodeReader != null) {
try { try {
barcodeReader.claim(); barcodeReader.claim();
} catch (ScannerUnavailableException e) { } catch (ScannerUnavailableException e) {
e.printStackTrace(); e.printStackTrace();
NotifyError("Scanner unavailable");
} }
} }
} }
@Override @Override
public void onPause(boolean multitasking) { public void onPause(boolean multitasking) {
super.onPause(multitasking);
if (barcodeReader != null) { if (barcodeReader != null) {
// release the scanner claim so we don't get any scanner // release the scanner claim so we don't get any scanner
// notifications while paused. // notifications while paused.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment