android - 手电筒在条形码扫描器程序 (Zxing) 中不起作用

标签 android barcode-scanner

我使用 ZXing 程序进行条码扫描,代码扫描效果很好,但程序中的闪光灯不工作任何对我进一步处理代码有帮助的建议。

提前致谢。

最佳答案

您可以尝试以下操作:

     CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
        TimeSpan timespan = new TimeSpan(0, 0, 0, 0, 0);
        Device.StartTimer(timespan, () =>
        {
            if (cancellationTokenSource.IsCancellationRequested)
            {
                return false;
            }

            scanner.Torch(true);

            return true;

        });

       scanner.Scan(Options);

关于android - 手电筒在条形码扫描器程序 (Zxing) 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7089000/

相关文章:

android - 无需安装第三方应用程序的条码阅读器

android - Android中String类型的RealmList

android - 在带有标题的 ListView 中实现 StickyListHeader

android - 使用字符串数组填充 Spinner

ios - 谷歌视觉 iOS 示例 : Scanned barcode Shape(purpleColor) shows in wrong location

c#-4.0 - 9 个代码中的 3 个在 mozila、IE 浏览器上不显示条码格式

android - 缺少 Unity Google Android 项目选项

android - close() 从未在数据库上显式调用

iphone - 如何使用phonegap 编译适用于iPhone 的条码扫描仪?

android - android中的条码扫描器不扫描