• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Making an adroid activity as the default activity?

nackasha

Lurker
Hello guys...

I have a question: I use android in eclipse. I forgot to add activity when i created a new project. So i added a new java class instead, now how would i make this java class as a default to launch activity that first launches when the application is run?

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

Note that the android:name attribute of the <Activity> node MUST begin with a '.' and is just the name of the java file. For example, if your java file was named Website.java, then the android:name attribute would be:

android:name=".Website"
 
Back
Top Bottom