Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build an Interactive Story App (Retired) Finishing the User Interface Creating the Story Layout

Transition between pages does not work

After i type my name and click begin adventure the application closes. My LogCat wants me to declare the activity in my manifest but i cant figure it out. Here is my manifest and LogCat:

05-21 11:36:16.786: D/dalvikvm(1353): GC_FOR_ALLOC freed 73K, 6% free 2819K/2968K, paused 63ms, total 64ms 05-21 11:36:16.796: I/dalvikvm-heap(1353): Grow heap (frag case) to 4.112MB for 1350016-byte allocation 05-21 11:36:16.866: D/dalvikvm(1353): GC_FOR_ALLOC freed <1K, 4% free 4137K/4288K, paused 62ms, total 62ms 05-21 11:36:17.076: D/(1353): HostConnection::get() New Host Connection established 0xb85a6ce8, tid 1353 05-21 11:36:17.156: W/EGL_emulation(1353): eglSurfaceAttrib not implemented 05-21 11:36:17.166: D/OpenGLRenderer(1353): Enabling debug mode 0 05-21 11:36:28.316: D/AndroidRuntime(1353): Shutting down VM 05-21 11:36:28.316: W/dalvikvm(1353): threadid=1: thread exiting with uncaught exception (group=0xb3a88ba8) 05-21 11:36:28.316: E/AndroidRuntime(1353): FATAL EXCEPTION: main 05-21 11:36:28.316: E/AndroidRuntime(1353): Process: com.lukan.signalsfrommars, PID: 1353 05-21 11:36:28.316: E/AndroidRuntime(1353): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.lukan.signalsfrommars/ui.StoryActivity}; have you declared this activity in your AndroidManifest.xml? 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1628) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.app.Activity.startActivityForResult(Activity.java:3424) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.app.Activity.startActivityForResult(Activity.java:3385) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:839) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.app.Activity.startActivity(Activity.java:3627) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.app.Activity.startActivity(Activity.java:3595) 05-21 11:36:28.316: E/AndroidRuntime(1353): at ui.MainActivity.startStory(MainActivity.java:51) 05-21 11:36:28.316: E/AndroidRuntime(1353): at ui.MainActivity.access$1(MainActivity.java:48) 05-21 11:36:28.316: E/AndroidRuntime(1353): at ui.MainActivity$1.onClick(MainActivity.java:42) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.view.View.performClick(View.java:4438) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.view.View$PerformClick.run(View.java:18422) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.os.Handler.handleCallback(Handler.java:733) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.os.Handler.dispatchMessage(Handler.java:95) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.os.Looper.loop(Looper.java:136) 05-21 11:36:28.316: E/AndroidRuntime(1353): at android.app.ActivityThread.main(ActivityThread.java:5017) 05-21 11:36:28.316: E/AndroidRuntime(1353): at java.lang.reflect.Method.invokeNative(Native Method) 05-21 11:36:28.316: E/AndroidRuntime(1353): at java.lang.reflect.Method.invoke(Method.java:515) 05-21 11:36:28.316: E/AndroidRuntime(1353): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 05-21 11:36:28.316: E/AndroidRuntime(1353): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 05-21 11:36:28.316: E/AndroidRuntime(1353): at dalvik.system.NativeStart.main(Native Method) 05-21 11:36:29.786: I/Process(1353): Sending signal. PID: 1353 SIG: 9


Here is my manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.lukan.signalsfrommars" android:versionCode="1" android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="14" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar" >
    <activity
        android:name="ui.MainActivity"
        android:label="@string/app_name" 
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
   <activity
            android:name="com.lukan.signalsfrommars.ui.StoryActivity"
            android:label="StoryActivity"
            android:parentActivityName="ui.MainActivity"

            >
        </activity>
</application>

</manifest>

1 Answer

Hello,

I'm not sure if this will solve the problem or not, but could you try changing

android:name="com.lukan.signalsfrommars.ui.StoryActivity"

to

android:name=".ui.StoryActivity"

If this doesn't work, please let us know so we can try further troubleshooting.

yep that worked thanks!

yep that worked thanks!

You're welcome. Have fun with Android Development.