我正试图从一个页面导航到另一个页面:
MyAdapter - > ShowArticle
但是上面的错误正在抛出,我在清单中添加了以下内容;但仍然无法正常工作。我对清单中的活动做错了吗?
我如何导航:
Intent intent = new Intent();
intent = new Intent(context, ShowArticle.class);
context.startActivity(intent);
清单声明:
<activity android:name="com.example.rssApplication.ShowArticle" android:label="@string/app_name"
android:parentActivityName="com.example.rssApplication.MyAdapter"
>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.rssApplication.MyAdapter" />
</activity>
LOG CAT:
07-17 14:07:18.200: E/AndroidRuntime(22694): FATAL EXCEPTION: main
07-17 14:07:18.200: E/AndroidRuntime(22694): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.rssapplication/com.example.rssapplication.ShowArticle}; have you declared this activity in your AndroidManifest.xml?
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1647)
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1441)
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.app.Activity.startActivityForResult(Activity.java:3464)
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.app.Activity.startActivityForResult(Activity.java:3425)
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.app.Activity.startActivity(Activity.java:3661)
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.app.Activity.startActivity(Activity.java:3629)
07-17 14:07:18.200: E/AndroidRuntime(22694): at com.example.rssapplication.MyAdapter$1.onClick(MyAdapter.java:84)
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.view.View.performClick(View.java:4475)
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.view.View$PerformClick.run(View.java:18786)
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.os.Handler.handleCallback(Handler.java:730)
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.os.Handler.dispatchMessage(Handler.java:92)
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.os.Looper.loop(Looper.java:137)
07-17 14:07:18.200: E/AndroidRuntime(22694): at android.app.ActivityThread.main(ActivityThread.java:5419)
07-17 14:07:18.200: E/AndroidRuntime(22694): at java.lang.reflect.Method.invokeNative(Native Method)
07-17 14:07:18.200: E/AndroidRuntime(22694): at java.lang.reflect.Method.invoke(Method.java:525)
07-17 14:07:18.200: E/AndroidRuntime(22694): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
07-17 14:07:18.200: E/AndroidRuntime(22694): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
07-17 14:07:18.200: E/AndroidRuntime(22694): at dalvik.system.NativeStart.main(Native Method)
任何帮助将不胜感激!
谢谢,
卡勒姆
更新:
由于下面留下的评论,我得到了解决方案。
1)在清单中,我宣布他的活动两次。删除元日期标记及其内容。 2)我正在执行ListActivity,而不是活动。我扩展了活动并且工作正常。
感谢所有帮助过的人!