Commit e7497d8d by Oscar Fuentes

Fix plugin helper

parent 38bd6038
......@@ -43,17 +43,19 @@ public class PluginHelper {
return;
}
mInstance.open(context);
mInstance.setScanCallback(new Barcode2DWithSoft.ScanCallback() {
@Override
public void onScanComplete(int i, int length, byte[] data) {
Log.i(TAG, "onScanComplete() i=" + i);
if (length < 1) {
return;
}
String barCode = new String(data);
barCode = barCode.replaceAll("\u0000", "");
Log.i(TAG, barCode);
mInstance.stopScan();
......@@ -63,25 +65,25 @@ public class PluginHelper {
}
});
mInstance.open(context);
boolean bContinuous = false;
Log.i("ErDActivity", "scan() ");
executor = cordova.getThreadPool();
if (threadStop) {
int iBetween = 0;
// thread = new Thread(new GetBarcode(bContinuous, iBetween));
// thread.start();
executor.execute(new GetBarcode(bContinuous, iBetween));
} else {
threadStop = true;
}
mInstance.scan();
//
// boolean bContinuous = false;
// Log.i("ErDActivity", "scan() ");
//
// executor = cordova.getThreadPool();
//
// if (threadStop) {
//
// int iBetween = 0;
//
// // thread = new Thread(new GetBarcode(bContinuous, iBetween));
// // thread.start();
//
// executor.execute(new GetBarcode(bContinuous, iBetween));
//
// } else {
// threadStop = true;
// }
}
private static class GetBarcode implements Runnable {
......
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