I got: android.content.ActivityNotFoundException: No activity found to handle intent{ act=com.google.zxing.client.android.SCAN cat=[android.intent.category.DEFAULT] flg=0x4080000 pkg=com.google.zxing.client.android} when I run my own app integrated with zxing barcode scanner. There is no logcat.
First of all I downloaded source code from zxing and build it into an app and runs fine, then I turn it into a library for my app and run my app then got the error above. Here are how to turn zxing barcode scanner into a lib for my app:
I. on myapp's AndroidManifest.xml, add
<activity android:name="com.google.zxing.client.android.CaptureActivity"
android:screenOrientation="landscape"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:configChanges="orientation|keyboardHidden"
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>
II. on myapp's MainActivity.java, I have this piece of code:
String package_name="com.google.zxing.client.android";
Intent iScan = new Intent(package_name+".SCAN");
iScan.setPackage(package_name);
iScan.addCategory(Intent.CATEGORY_DEFAULT);
iScan.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
iScan.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
iScan.putExtra("SCAN_WIDTH", 420);
iScan.putExtra("SCAN_HEIGHT", 420);
iScan.putExtra("RESULT_DISPLAY_DURATION_MS", 3000L);
iScan.putExtra("SCAN_MODE", "QR_CODE_MODE");
iScan.putExtra("PROMPT_MESSAGE", "Scan the Contact");
startActivityForResult(iScan, 0);
III. On my Project Properties->Android,
add com.google.xing.client.android as lib and copy
com.google.xing.client.android.captureactivity.jar core.jar to libs dir of my app