Tôi đã thử trình đọc mã vạch Google từ https://github.com/googlesamples/android-visionKhông thể sử dụng máy quét mã vạch Google
Ví dụ này không hoạt động. Khi tab tôi để sàng lọc nó luôn luôn phát hiện
"không mã vạch phát hiện"
gỡ lỗi Lý do:
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
biến luôn là Null
Xem hình ảnh:
Bất kỳ ai gặp sự cố này? Bạn có thể cho tôi biết cách giải quyết nó không? Cảm ơn bạn rất nhiều!
Bạn đang thử phần cứng này trên phần cứng nào? –