Bonjour,
J'ai développé une petite application du scan code barre EAN13 mais le problème c'est que lorsque je clique sur le bouton, il m'affiche ce message:Avec la seule Activité ShowBarcodeActivity.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 01-03 14:45:10.980: ERROR/AndroidRuntime(507): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.google.zxing.client.android.SCAN (has extras) } 01-03 14:45:10.980: ERROR/AndroidRuntime(507): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408) 01-03 14:45:10.980: ERROR/AndroidRuntime(507): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378) 01-03 14:45:10.980: ERROR/AndroidRuntime(507): at android.app.Activity.startActivityForResult(Activity.java:2817) 01-03 14:45:10.980: ERROR/AndroidRuntime(507): at com.easymorse.ShowBarcodeActivity$1.onClick(ShowBarcodeActivity.java:33) 01-03 14:45:10.980: ERROR/AndroidRuntime(507): at android.view.View.performClick(View.java:2408) 01-03 14:45:10.980: ERROR/AndroidRuntime(507): at android.view.View$PerformClick.run(View.java:8816) 01-03 14:45:10.980: ERROR/AndroidRuntime(507): at android.os.Handler.handleCallback(Handler.java:587) 01-03 14:45:10.980: ERROR/AndroidRuntime(507): at android.os.Handler.dispatchMessage(Handler.java:92) .... ..... ...... .......Je pense que le problème vient du fichier AndroidManifest.xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 package com.easymorse; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; public class ShowBarcodeActivity extends Activity { private Button button; private Button button2; private TextView textView; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.button = (Button) this.findViewById(R.id.Button01); this.button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent( "com.google.zxing.client.android.SCAN"); intent.putExtra("SCAN_MODE", "QR_CODE_MODE"); startActivityForResult(intent, 0); } }); this.button2 = (Button) this.findViewById(R.id.Button02); this.button2.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent( "com.google.zxing.client.android.SCAN"); intent.putExtra("SCAN_MODE", "EAN_13"); startActivityForResult(intent, 0); } }); this.textView = (TextView) this.findViewById(R.id.hello); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode != 0) { return; } this.textView.setText(data.getStringExtra("SCAN_RESULT")); } }Merci d'avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.easymorse" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".ShowBarcodeActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="8" /> </manifest>
Partager