android: zxing barcode scan successful but not returning from activity

后端 未结 5 667
悲哀的现实
悲哀的现实 2021-01-04 06:23

I am successfully using zxing to scan codes, by calling the installed barcode reader\'s intent, but when it beeps and indicates a good scan I expect the zxing activity would

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-04 06:30

    I was having the same issue so I tried using the IntentIntegrator class as recommended by Sean Owen. I still had the problem until I realized this was only happening when trying to scan a barcode in portrait (most frequently on phones). It turns out that the orientation change from portrait to landscape causes the double scan. I resolved this by adding android:configChanges="orientation|keyboardHidden|screenSize" to the activity in my manifest. You probably only need the orientation one, but that is untested.

    For any users experiencing this issue when creating an Adobe AIR Native Extension, be sure to add that line not only to your android project manifest, but also to your activity tag in your android manifest additions in your app.xml.

提交回复
热议问题