I tried Google barcode-reader from https://github.com/googlesamples/android-vision
This example doesn't work. When I tab to screen it always detect
"no barcode detected"
Debug reason :
private boolean onTap(float rawX, float rawY) {
//TODO: use the tap position to select the barcode.
BarcodeGraphic graphic = mGraphicOverlay.getFirstGraphic();
Barcode barcode = null;
if (graphic != null) {
barcode = graphic.getBarcode();
if (barcode != null) {
Intent data = new Intent();
data.putExtra(BarcodeObject, barcode);
setResult(CommonStatusCodes.SUCCESS, data);
finish();
}
else {
Log.d(TAG, "barcode data is null");
}
}
else {
Log.d(TAG,"no barcode detected");
}
return barcode != null;
}
graphic
variable is always Null
See the image:
Anyone faced this problem? Can you let me know how to resolve it? Thank you so much!