【发布时间】:2015-12-20 07:35:40
【问题描述】:
我已经在我的应用程序中实现了 Zxing 条码扫描库。我使用了以下库: https://code.google.com/p/barcodefraglibv2/ 我想在扫描时单击按钮打开/关闭闪光灯,但我无法做到这一点。图书馆已经公开了一个相同的功能,但它不起作用。
使用的代码是: 片段 = (BarcodeFragment)getSupportFragmentManager().findFragmentById(R.id.sample); fragment.getCameraManager().setTorch(true);
提供我可以打开/关闭手电筒的任何参考代码。
【问题讨论】:
-
使用 setTorchOn 开启,使用 setTorchOff 关闭 stackoverflow.com/questions/35993253/…
标签: android android-fragments zxing barcode-scanner