我的应用程序使用ZXing帮助程序类IntentIntegrator和IntentResult来使用ZXing条形码扫描程序.
现在我发现ZXing不再提交扫描结果,相关的返回值为空/空.
因此,我更新到最新的帮助程序类http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java和http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentResult.java
现在我的onActivityResult方法在ZXing启动后立即调用 – 当然再次出现空结果.
我的代码非常简单,扫描以这种方式启动:
if (v==scanButton)
{
com.google.zxing.integration.android.IntentIntegrator integrator = new IntentIntegrator(this);
integrator.initiateScan();
}
并以这种方式获取结果:
public void onActivityResult(int requestCode,int resultCode,Intent intent)
{
com.google.zxing.integration.android.IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode,resultCode,intent);
if (scanResult != null)
{
String format;
format=scanResult.getFormatName();
if ((format!=null) && (format.length()>0))
{
if ((format.equals("EAN_8")) || (format.equals("EAN_13")) ||(format.equals("UPC_A")) ||(format.equals("UPC_E")))
getEANData(scanResult.getContents());
}
}
}
在我的android上安装了最新的ZXing代码.任何想法为什么它不再起作用?