tags:

views:

47

answers:

3

I have three activities in my android app. First activity is main application screen which gives option to open second screen containing second activity. But when I click on the button on second activity which was supposed to open third activity screen, I get "Application has stopped unexpectedly" error.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="org.anddev.android.SampleApp"
  android:versionCode="1"
  android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".FirstActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".SecondActivity"
              android:label="@string/app_name" >
   </activity>        

    <activity android:name=".ThirdActivity"
              android:label="@string/app_name" >
    </activity>
</application>

+1  A: 

Maybe you can use debug tools to find out what makes the application stop actually. For example, it may be caused by a NullPointerReference exception, which you can find out in the debug log.

ZelluX
Well second activity is getting called from first activity with intent correctly, but third activity gives problem with intent.
yogsma
+1  A: 

It is probably something in the initialization code of the third Activy. Debug it and step through the OnCreate method. Run it in the emulator and Logcat should show you why it is failing though.

Rob Kent
A: 

I used this http://www.winksaville.com/blog/programming/debug-logging-in-android/ to debug my app and found out that I was using wrong view name.

yogsma