我从https://github.com/googlesamples/android-vision尝试了谷歌条形码阅读器
这个例子不起作用。当我点击屏幕时,它总是检测到
“未检测到条形码”
调试原因:
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
变量总是Null
看图片:
有人遇到过这个问题吗?你能告诉我如何解决吗?太感谢了!