Android - Problems starting up to work properly?

Ok guys, I'm a super newbie to this, so bear with me ... I basically read the Android development book and follow the tutorial.

This application has 7 actions (1 is called QuizActivity, which extends Activity, and 6 more others that extend QuizActivity - 1 of which is QuizSplashActivity, the one I want to run at startup)

However, I am very confused about why the default activity does not seem to start. My manifest has the correct tags for QuizSplashActivity, and QuizSplashActivity points to the correct .xml layout file I created. However, when I run the program, the console says:

[2013-03-11 17:19:47 - BeenThereDoneThat] Initial activity com.example.beentheredonethat.QuizActivity on the device emulator -5554

[2013-03-11 17:19:48 - BeenThereDoneThat] ActivityManager: Start: Intent {act = android.intent.action.MAIN cat = [android.intent.category.LAUNCHER] cmp = com.example.beentheredonethat / .QuizActivity }

Here is the manifest application section:

 <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="QuizSplashActivity"
            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="QuizActivity"></activity>
        <activity android:name="QuizGameActivity"></activity>
        <activity android:name="QuizHelpActivity"></activity>
        <activity android:name="QuizMenuActivity"></activity>
        <activity android:name="QuizScoresActivity"></activity>
        <activity android:name="QuizSettingsActivity"></activity>
    </application>

And here is my QuizSplashActivity, which I want to show at startup:

package com.example.beentheredonethat;

import android.os.Bundle;
import android.view.Menu;


public class QuizSplashActivity extends QuizActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_quiz, menu);
        return true;
    }


}

Any ideas as to why this is being done? Any help would be greatly appreciated. Thank!

+5
source share
1 answer

I think the problem is that you are manifesting yourself in the declaration of Acts. You are missing a dot to the action name:

android:name=".QuizSplashActivity"

and the compiler cannot find your activity. Try to fix it and it should work. Also try cleaning up the project, restart Eclipse and run the application again.

+1

All Articles