I'm using zxing in my app to scan barcodes, and I've got it scanning just fine. We have several apps that do scanning, however (different branded apps for each customer), and I see that when I start the Activity to scan a barcode, the phone asks which app I want to use. There are two problems with that. First, I want each app to always use ITSELF as the scanning app when the scan button is clicked, and second, I don't want another app that I didn't write trying to use my app to scan barcodes.
How do I enforce the first item and prevent the second? I tried to find something to put into the manifest, maybe, but didn't come up with anything.
EDIT - here's the manifest (with some information obscured) (the app presents a LoginActivity, then the screen with the scan button (MainActivity), then sends the barcode to a website which returns more information, displayed in the ResultActivity):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.MyCompany.MyApp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="10" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:name="android.hardware.camera"
required="true" />
<application
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/MyTheme" >
<activity
android:name="com.MyCompany.MyApp.LoginActivity"
android:clearTaskOnLaunch="true"
android:label="@string/app_name"
android:windowSoftInputMode="stateHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.MyCompany.MyApp.MainActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.MyCompany.MyApp.HelpActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.MyCompany.MyApp.ResultActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.google.zxing.client.android.CaptureActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden" >
<intent-filter>
<action android:name="com.google.zxing.client.android.SCAN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
They are actually the same issue...Do you call zxing through an intent to use its scanner? If so, your own apps are probably listening to the same intent, which causes them to react when you start a scan.
You can check your manifest for activities that have an intent filter of scanning.
-----------Update---------
That CaptureActivity has the intent filter for Scan. That's the cause. If you have embedded zxing's code into your app instead of calling their app, you can remove this intent filter.