0

我从这里跟随示例 我收到以下错误GraphicalActivity

错误日志:

05-11 15:51:11.749: E/AndroidRuntime(7353): FATAL EXCEPTION: main
05-11 15:51:11.749: E/AndroidRuntime(7353): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.emazdoor.achartdroid/com.emazdoor.achartdroid.ChartActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.emazdoor.achartdroid/org.achartengine.GraphicalActivity}; have you declared this activity in your AndroidManifest.xml?
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.app.ActivityThread.access$1500(ActivityThread.java:121)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.os.Looper.loop(Looper.java:130)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.app.ActivityThread.main(ActivityThread.java:3701)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at java.lang.reflect.Method.invokeNative(Native Method)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at java.lang.reflect.Method.invoke(Method.java:507)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at dalvik.system.NativeStart.main(Native Method)
05-11 15:51:11.749: E/AndroidRuntime(7353): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.emazdoor.achartdroid/org.achartengine.GraphicalActivity}; have you declared this activity in your AndroidManifest.xml?
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.app.Activity.startActivityForResult(Activity.java:2827)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.app.Activity.startActivity(Activity.java:2933)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at com.emazdoor.achartdroid.ChartActivity.onCreate(ChartActivity.java:25)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-11 15:51:11.749: E/AndroidRuntime(7353):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
05-11 15:51:11.749: E/AndroidRuntime(7353):     ... 11 more

有人可以告诉我这里有什么问题吗?我也添加了 ChartActivity AndroidMenifest.xml。但是错误不断出现。线上也有一处错误

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Intent intent = createIntent();
        startActivity(intent);

    }
4

3 回答 3

2

把它放在你的 AndroidManifest.Xml 中:

<activity android:name="org.achartengine.GraphicalActivity" />
于 2013-05-11T10:55:00.563 回答
2

听起来您的 AndroidManifest.xml 文件中没有此活动。

添加到您的清单文件:

<activity
            android:name="org.achartengine.GraphicalActivity" >
        </activity>
于 2013-05-11T10:55:11.617 回答
1

您尚未GraphicalActivity在 AndroidManifest.xml 中声明该活动。你必须记住,每当你创建一个新的活动时,你应该AndroidManifest像这样将活动添加到文件中:

<activity android:name=".newActivity">

添加这个:

<activity android:name="org.achartengine.GraphicalActivity" />
于 2013-05-11T10:55:18.393 回答