views:

168

answers:

1

I have created the meat and guts of my application but I want to add a different activity that will be the starting point (sort of a log-in screen).

Couple questions: 1) I have a fairly decent handle on how to switch between activities (based on this article: http://www.linux-mag.com/id/7498) but I'm not sure how to go about creating a new one (with eclipse). 2) once I have a new activity created, how can I set it as the default activity of my application? I presume I could just change the name of the classes...but is there a more elegant way to handle that (maybe within the AndroidManifest.xml)?

+2  A: 

Yep you are gonna use the manifest file, you can actually even have more than one launcher activity specified in your application manifest. To make an activity seen on the launcher you add these attributes to your activity in the manifest

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
schwiz
For anyone that doesn't know what the manifest this post is talking about, it is the AndroidManifest.xml in the root of your project. In Eclipse you can double click it and click the tab on the furthest right to edit the XML directly.
Austyn Mahoney
great thanks. So by including that intent-filter node with it's child nodes, that makes whatever activity it's in the first one to load when the application starts?
Kyle