我有一个片段,我正试图从一个按钮单击开始另一个活动,如下所示:
Intent i = new Intent(getActivity(), RoundPagerActivity.class);
// put extras
startActivity(i);
应用程序在调用 时startActivity(i)
崩溃Fatal Exception
。这是日志猫:
08-24 22:08:12.625: D/AndroidRuntime(9865): Shutting down VM
08-24 22:08:12.625: W/dalvikvm(9865): threadid=1: thread exiting with uncaught exception(group=0x40c231f8)
08-24 22:08:12.720: E/AndroidRuntime(9865): FATAL EXCEPTION: main
08-24 22:08:12.720: E/AndroidRuntime(9865): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.wilk.android.tablink/com.wilk.android.tablink.RoundPagerActivity}; have you declared this activity in your AndroidManifest.xml?
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1511)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1387)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.app.Activity.startActivityForResult(Activity.java:3190)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:826)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.support.v4.app.Fragment.startActivity(Fragment.java:838)
08-24 22:08:12.720: E/AndroidRuntime(9865): at com.wilk.android.tablink.RoundListFragment.onListItemClick(RoundListFragment.java:94)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.widget.AdapterView.performItemClick(AdapterView.java:292)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.widget.AbsListView.performItemClick(AbsListView.java:1175)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2703)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.widget.AbsListView$1.run(AbsListView.java:3456)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.os.Handler.handleCallback(Handler.java:605)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.os.Handler.dispatchMessage(Handler.java:92)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.os.Looper.loop(Looper.java:137)
08-24 22:08:12.720: E/AndroidRuntime(9865): at android.app.ActivityThread.main(ActivityThread.java:4507)
08-24 22:08:12.720: E/AndroidRuntime(9865): at java.lang.reflect.Method.invokeNative(Native Method)
08-24 22:08:12.720: E/AndroidRuntime(9865): at java.lang.reflect.Method.invoke(Method.java:511)
08-24 22:08:12.720: E/AndroidRuntime(9865): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
08-24 22:08:12.720: E/AndroidRuntime(9865): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
08-24 22:08:12.720: E/AndroidRuntime(9865): at dalvik.system.NativeStart.main(Native Method)
这是我的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wilk.android.tablink"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo" >
<!-- other activities -->
<!-- activity that calls the pager activity -->
<activity
android:name="com.wilk.android.tablink.RoundListActivity"
android:label="@string/app_name" >
</activity>
<!-- activity that is called -->
<activity
android:name="com.wilk.android.tablink.RoundPagerAcivity"
android:label="@string/app_name" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.wilk.android.tablink.RoundListActivity" />
</activity>
</application>
</manifest>
奇怪的是,我有另一个应用程序以完全相同的方式执行此操作而没有问题。我在这里查看了其他问题,并且很确定我已经用尽了这些选择,至少是那些似乎适用的选择。我也尝试在新活动中设置断点,但没有一个被击中。谁能看到我刚刚忽略的东西?