my app makes use of ZXing barcode scanner using the ZXing helper classes IntentIntegrator and IntentResult.
Now I found there are no longer scanning results submitted from ZXing, the related return values are empty/null.
Thus I updated to latest helper classes http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java and http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentResult.java
Now my onActivityResult method is called immediately after ZXing is started – of course with an empty result again.
My code is quite simple, scanning is started this way:
if (v==scanButton)
{
com.google.zxing.integration.android.IntentIntegrator integrator = new IntentIntegrator(this);
integrator.initiateScan();
}
and fetching the results this way:
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());
}
}
}
On my android the latest ZXing code is installed. Any ideas why it does not work any more?
From what I found out meanwhile: this seems to be an installation-dependent problem. On my Android device I can see that problem but it is not reproducible, other users of my App do not experience this. ZXing code itself wasn’t changed for longer time and there users confirm it works too – so that seems to be a really ugly bug.
Here it happens with ZXing-code installed from Playstore, haven’t tested it with ZXing included into my app yet…