ZXing如何扫描QR- code和一维条码code? [英] ZXing how to scan QR-Code AND 1D barcode?
本文介绍了ZXing如何扫描QR- code和一维条码code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚导入的ZXing库在我的应用程序,我知道如何设置了 putExtra
函数的扫描QR- code吧$ C $ ç
I just imported the ZXing library in my app, I know how to set up the putExtra
function to scan QR-Code barcode:
INTENT = new Intent("com.google.zxing.client.android.SCAN");
INTENT.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(INTENT, 0);
如果我想扫描一维条码code
INTENT = new Intent("com.google.zxing.client.android.SCAN");
INTENT.putExtra("SCAN_MODE", "PRODUCT_MODE");
startActivityForResult(INTENT, 0);
但如何让我的应用程序能同时扫描? (一维和二维条码code)。
but how do I make the App able to scan both?? (1D and 2D barcode).
谢谢! 马可
推荐答案
如果你只是想同时扫描(而不是仅仅两个):
If you just want to scan both (and not exclusively these two):
不要添加 SCAN_MODE
额外的意图。那是可选限制巴code中的类型到某一类型。不指定它会扫描所有可能的类型。
Don't add the SCAN_MODE
extra to the intent. Thats optional to limit the type of barcode to a certain type. Not specifying it will scan all possible types.
这篇关于ZXing如何扫描QR- code和一维条码code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文