2

我使用tabhost,当我想通过imagebutton移动到新活动时,模拟器检查这些错误

05-22 19:18:23.021: E/AndroidRuntime(879): FATAL EXCEPTION: main
05-22 19:18:23.021: E/AndroidRuntime(879): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.projet/com.projet.Inter_produit}; have you declared this activity in your AndroidManifest.xml?
05-22 19:18:23.021: E/AndroidRuntime(879):  at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
05-22 19:18:23.021: E/AndroidRuntime(879):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
05-22 19:18:23.021: E/AndroidRuntime(879):  at android.app.Activity.startActivityFromChild(Activity.java:3057)
05-22 19:18:23.021: E/AndroidRuntime(879):  at android.app.Activity.startActivityForResult(Activity.java:2837)
05-22 19:18:23.021: E/AndroidRuntime(879):  at android.app.Activity.startActivity(Activity.java:2923)
05-22 19:18:23.021: E/AndroidRuntime(879):  at com.projet.Accueil$1.onClick(Accueil.java:24)
05-22 19:18:23.021: E/AndroidRuntime(879):  at android.view.View.performClick(View.java:2408)
05-22 19:18:23.021: E/AndroidRuntime(879):  at android.view.View$PerformClick.run(View.java:8816)
05-22 19:18:23.021: E/AndroidRuntime(879):  at android.os.Handler.handleCallback(Handler.java:587)
05-22 19:18:23.021: E/AndroidRuntime(879):  at     android.os.Handler.dispatchMessage(Handler.java:92)
05-22 19:18:23.021: E/AndroidRuntime(879):  at android.os.Looper.loop(Looper.java:123)
05-22 19:18:23.021: E/AndroidRuntime(879):  at android.app.ActivityThread.main(ActivityThread.java:4627)
05-22 19:18:23.021: E/AndroidRuntime(879):  at java.lang.reflect.Method.invokeNative(Native Method)
05-22 19:18:23.021: E/AndroidRuntime(879):  at java.lang.reflect.Method.invoke(Method.java:521)
05-22 19:18:23.021: E/AndroidRuntime(879):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-22 19:18:23.021: E/AndroidRuntime(879):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-22 19:18:23.021: E/AndroidRuntime(879):  at dalvik.system.NativeStart.main(Native Method)
4

1 回答 1

2

考虑将您的类(文件和文件中的类名)从 Inter_produit 重命名为 InterProduit,并将其作为 Activity 添加到 Manifest.xml。

像这样:

<activity android:name=".InterProduit"/>

如果它在您的应用程序包中。

于 2012-06-12T19:44:32.007 回答