First, there is no "zxing lib". You are supposed to use the Barcode Scanner application, tying it into your application at the activity level, ideally using their IntentIntegrator
code. Here is a sample application demonstrating this. The creators of ZXing specifically do not support or endorse baking the Barcode Scanner source code into another application.
However, given your symptoms, I have to assume that you are trying to add the Barcode Scanner source code to your own application.
You presumably have something like this in your manifest on the scanning activity's element:
<intent-filter >
<action android:name="com.google.zxing.client.android.SCAN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
You are not Barcode Scanner. Yet, this <intent-filter>
claims that you are Barcode Scanner.
You need to remove this <intent-filter>
, modify your copy of the Barcode Scanner source code to not require it, and then start up the scanning activity using the component-based Intent
constructor (e.g., new Intent(this, ThisIsYourRevisedScanningActivity.class)
).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…