-1
即時通訊使用我的代碼中的條形碼庫工作正常當我運行模擬器這個錯誤將來到由於:android.content.ActivityNotFoundException:沒有找到活動發現處理意圖{動作= com。 google.zxing.client.android.SCAN}條形碼編譯時顯示錯誤請幫助我
package my.finalyear.demo;
public class CaptureActivity extends Activity {
final Context context = this;
String contents;
String searchFor;
static final String KEY_ITEM = "item"; // parent node
static final String KEY_ID = "id";
static final String KEY_NAME = "name";
static final String KEY_COST = "cost";
static final String KEY_DESC = "description";
public static String name, cost, description;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
startActivityForResult(intent, 0);
}
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == 0) {
if (resultCode == RESULT_OK) {
// String result =intent.getAction();
contents = intent.getStringExtra("SCAN_RESULT");
String format =
intent.getStringExtra("SCAN_RESULT_FORMAT");
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.finalyear.demo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
/>
<application
android:icon="@drawable/launcher_icon"
android:label="@string/app_name"
>
<activity
android:name=".LoginActivity" android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:label="MainScreen"
android:name=".CaptureActivity" >
</activity>
<activity
android:label="Single Menu Item"
android:name="my.finalyear.demo.SingleMenuItemActivity" >
</activity>
</application>
<uses-permission android:name="android.permission.CAMERA"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:name="android.hardware.camera.flash" />
使用條碼庫在我的代碼
http://stackoverflow.com/questions/12220140/no-activity-found-to-handle-intentact-com-google-zxing-client-android-scan-cat – L7ColWinters
https://code.google.com/p /斑馬線/維基/ ScanningViaIntent – Voicu