Android Zxing中如何调用ExpandedProductResultParser
我有一个条形码扫描仪应用程序,它是基于出色的 Zxing 库构建的。我想知道是否可以通过在 android 活动中调用 ExpandedProductResultParser 等来使用 getLotNumber 方法。如果是,如何?
“Zxing 条码应用程序中出现相机错误” - 这是我基于 Zxing 构建的应用程序。
现在我想从条形码中提取批号。我在 onActivityResult() 中尝试过:
String contents = intent.getStringExtra("SCAN_RESULT");
//String format = intent.getStringExtra("SCAN_FORMATS");
Bundle bar=intent.getExtras();
System.out.println("Bundleeeeeeeeeeeeeeeeee :::::::::::" + bar );
String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
System.out.println("Formaattttttttttttttt " + format);
Result result=new Result(contents, null, null, BarcodeFormat.CODE_128);
ResultParser.parseResult(result);
//ExpandedProductResultParser
在这里,我如何传递从 Result() 中的条形码捕获的实际格式?
另外我如何利用 ExpandedProductResultParser.parse() 获取lotNumber的方法?
谢谢
斯内哈
I have a Barcode scanner application which is built upon the great Zxing library. I wanted to know if I can make use of getLotNumber method by calling ExpandedProductResultParser etc in android activity. If yes, How?
"Getting Camera error in Zxing Barcode Application"
- this is the application i have built on based Zxing.
Now I want to extract Lot Number from the BarCode. What I have tried is this in onActivityResult() :
String contents = intent.getStringExtra("SCAN_RESULT");
//String format = intent.getStringExtra("SCAN_FORMATS");
Bundle bar=intent.getExtras();
System.out.println("Bundleeeeeeeeeeeeeeeeee :::::::::::" + bar );
String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
System.out.println("Formaattttttttttttttt " + format);
Result result=new Result(contents, null, null, BarcodeFormat.CODE_128);
ResultParser.parseResult(result);
//ExpandedProductResultParser
Here, how can i pass actual format that is captured from barcode in Result()?
Also how can i make use of ExpandedProductResultParser.parse()
method to get lotNumber?
Thanks
Sneha
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你在使用意图吗?是的,只需使用返回的 String 上的类来解析它即可。有什么问题吗?
Are you using Intents? Yes, just use the class on the
String
you get back to parse it. What's the issue?