Search code examples
androideclipseadt

App getting crashed when i press a ButtonImage. Unafortunately the app has stopped working


i was doing a code for an application that uses a ImageButton and I've been getting the message "Unfortunately <appname> has stopped working" when I run the app and press the ImageButton.

I'm new on these kind of app, so I don't really know what's wrong with my code because I don't have any errors on the code.

If you can help me on this I will be very grateful. I include my Logcat:

    04-12 04:55:46.646: D/dalvikvm(775): GC_FOR_ALLOC freed 63K, 7% free 2654K/2840K, paused 57ms, total 69ms
04-12 04:55:46.824: D/dalvikvm(775): GC_CONCURRENT freed 204K, 11% free 2856K/3192K, paused 21ms+7ms, total 72ms
04-12 04:55:46.884: D/dalvikvm(775): GC_FOR_ALLOC freed 1K, 11% free 2871K/3192K, paused 34ms, total 34ms
04-12 04:55:46.924: I/dalvikvm-heap(775): Grow heap (frag case) to 4.640MB for 1808416-byte allocation
04-12 04:55:46.996: D/dalvikvm(775): GC_FOR_ALLOC freed <1K, 7% free 4637K/4960K, paused 72ms, total 72ms
04-12 04:55:47.084: D/dalvikvm(775): GC_CONCURRENT freed <1K, 7% free 4637K/4960K, paused 7ms+3ms, total 92ms
04-12 04:55:47.214: D/dalvikvm(775): GC_FOR_ALLOC freed <1K, 7% free 4637K/4960K, paused 37ms, total 37ms
04-12 04:55:47.263: I/dalvikvm-heap(775): Grow heap (frag case) to 7.708MB for 3216416-byte allocation
04-12 04:55:47.374: D/dalvikvm(775): GC_CONCURRENT freed 0K, 5% free 7778K/8104K, paused 15ms+3ms, total 106ms
04-12 04:55:48.105: D/gralloc_goldfish(775): Emulator without GPU emulation detected.
04-12 04:57:00.395: D/AndroidRuntime(775): Shutting down VM
04-12 04:57:00.395: W/dalvikvm(775): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
04-12 04:57:00.405: E/AndroidRuntime(775): FATAL EXCEPTION: main
04-12 04:57:00.405: E/AndroidRuntime(775): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.movil.ejemploventanas/com.movil.ejemploventanas.DatosPersonales}; have you declared this activity in your AndroidManifest.xml?
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618)
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.app.Activity.startActivityForResult(Activity.java:3370)
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.app.Activity.startActivityForResult(Activity.java:3331)
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.app.Activity.startActivity(Activity.java:3566)
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.app.Activity.startActivity(Activity.java:3534)
04-12 04:57:00.405: E/AndroidRuntime(775):  at com.movil.ejemploventanas.Principal$1.onClick(Principal.java:22)
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.view.View.performClick(View.java:4204)
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.view.View$PerformClick.run(View.java:17355)
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.os.Handler.handleCallback(Handler.java:725)
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.os.Handler.dispatchMessage(Handler.java:92)
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.os.Looper.loop(Looper.java:137)
04-12 04:57:00.405: E/AndroidRuntime(775):  at android.app.ActivityThread.main(ActivityThread.java:5041)
04-12 04:57:00.405: E/AndroidRuntime(775):  at java.lang.reflect.Method.invokeNative(Native Method)
04-12 04:57:00.405: E/AndroidRuntime(775):  at java.lang.reflect.Method.invoke(Method.java:511)
04-12 04:57:00.405: E/AndroidRuntime(775):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-12 04:57:00.405: E/AndroidRuntime(775):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-12 04:57:00.405: E/AndroidRuntime(775):  at dalvik.system.NativeStart.main(Native Method)

Solution

  • Add below line in manifest inside application tag

    <activity android:name="com.movil.ejemploventanas.DatosPersonales"/>