当我按下开始按钮时,我的应用程序崩溃了

时间:2013-07-18 13:42:56

标签: java android

07-18 16:38:30.393: D/dalvikvm(24807): Late-enabling CheckJNI
07-18 16:38:30.503: E/Trace(24807): error opening trace file: No such file or directory (2)
07-18 16:38:30.698: D/dalvikvm(24807): GC_FOR_ALLOC freed 37K, 9% free 9354K/10179K, paused 55ms, total 55ms
07-18 16:38:30.738: I/dalvikvm-heap(24807): Grow heap (frag case) to 15.894MB for 6454816-byte allocation
07-18 16:38:30.823: D/dalvikvm(24807): GC_CONCURRENT freed <1K, 6% free 15656K/16519K, paused 11ms+9ms, total 63ms
07-18 16:38:31.028: D/libEGL(24807): loaded /system/lib/egl/libEGL_mali.so
07-18 16:38:31.048: D/libEGL(24807): loaded /system/lib/egl/libGLESv1_CM_mali.so
07-18 16:38:31.063: D/libEGL(24807): loaded /system/lib/egl/libGLESv2_mali.so
07-18 16:38:31.073: D/(24807): Device driver API match
07-18 16:38:31.073: D/(24807): Device driver API version: 10
07-18 16:38:31.073: D/(24807): User space API version: 10 
07-18 16:38:31.073: D/(24807): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Thu Oct 25 08:43:05 KST 2012 
07-18 16:38:31.123: D/OpenGLRenderer(24807): Enabling debug mode 0
07-18 16:38:38.898: D/AndroidRuntime(24807): Shutting down VM
07-18 16:38:38.898: W/dalvikvm(24807): threadid=1: thread exiting with uncaught exception (group=0x410e92a0)
07-18 16:38:38.903: E/AndroidRuntime(24807): FATAL EXCEPTION: main
07-18 16:38:38.903: E/AndroidRuntime(24807): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.ahmadghaddar.riddles/com.ahmadghaddar.riddles.Easy}; have you declared this activity in your AndroidManifest.xml?
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1556)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1431)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.app.Activity.startActivityForResult(Activity.java:3446)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.app.Activity.startActivityForResult(Activity.java:3407)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.app.Activity.startActivity(Activity.java:3617)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.app.Activity.startActivity(Activity.java:3585)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at com.ahmadghaddar.riddles.MainActivity.onClick(MainActivity.java:72)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.view.View.performClick(View.java:4232)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.view.View$PerformClick.run(View.java:17298)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.os.Handler.handleCallback(Handler.java:615)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.os.Handler.dispatchMessage(Handler.java:92)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.os.Looper.loop(Looper.java:137)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at android.app.ActivityThread.main(ActivityThread.java:4921)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at java.lang.reflect.Method.invokeNative(Native Method)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at java.lang.reflect.Method.invoke(Method.java:511)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
07-18 16:38:38.903: E/AndroidRuntime(24807):    at dalvik.system.NativeStart.main(Native Method)

嗨,我在运行新应用后出现此错误。当我按下与新活动和布局相关的按钮时崩溃,布局包含一个array.xml 请告诉我如何解决这个问题。谢谢

2 个答案:

答案 0 :(得分:1)

您需要将此活动[com.ahmadghaddar.riddles / com.ahmadghaddar.riddles.Easy]添加到您的androidManifest.xml文件

答案 1 :(得分:1)

正如您在此行消息中所看到的,您没有在清单中声明活动

07-18 16:38:38.903: E/AndroidRuntime(24807): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.ahmadghaddar.riddles/com.ahmadghaddar.riddles.Easy}; have you declared this activity in your AndroidManifest.xml?

您必须在AndroidManifest.xml文件中声明它,如下所示:

<activity
    android:name="com.ahmadghaddar.riddles.Easy"
    android:label="@string/app_name" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

P.S。谨慎对待您的意图过滤器andorid:nameandroid:category,因为它们会改变您应用的行为。