使用BarChartExample时意图给出错误

时间:2013-05-11 10:52:50

标签: android charts achartengine

我正在关注here的示例 我收到关于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

请问这里的任何人请告诉我这里有什么问题吗?我也在AndroidMenifest.xml添加了ChartActivity。但错误不断回归。第

行也有一个错误
 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

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

    }

3 个答案:

答案 0 :(得分:2)

将其放入AndroidManifest.Xml:

<activity android:name="org.achartengine.GraphicalActivity" />

答案 1 :(得分:2)

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

添加到您的清单文件中:

<activity
            android:name="org.achartengine.GraphicalActivity" >
        </activity>

答案 2 :(得分:1)

您尚未在AndroidManifest.xml中声明GraphicalActivity活动。您必须记住,无论何时创建新活动,都应将活动添加到AndroidManifest文件中,如下所示:

<activity android:name=".newActivity">

添加:

<activity android:name="org.achartengine.GraphicalActivity" />