hemanth kumar hemanth kumar - 5 months ago 24
Android Question

How to change the startup activity in android?

I have two activities namely

login
and
calendar
in my Application. Currently my
startup
activity is "
calendar
". I want to run the
login
as first activity not
calendar
.

Answer Source

The startup activity [Launcher Activity] is declared in the projects' AndroidManifest.xml file

Look for that activity tag in the manifest which looks like this

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

Look at the attribute android:name. Main is the class which is launched when the app starts. Currently your calendar activity name should be there. Change that to the .classpath of your activity that you want to launch.

That should do it. You may also want to do the hello world application in the tutorials and go through the docs a little to see how Android Applications work.