Home > DeveloperSection > Interviews > How to define an Activity as launcher activity in application Manifest file?

Posted on    June-08-2015 12:13 AM

 Android Android 
Ratings:
 1 Answer(s)
  397  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    June-08-2015 12:13 AM

All the activities used in the application should be defined in application manifest file. For launcher activity you need to define intent filter as shown in the below code snippets.

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

Don't want to miss updates? Please click the below button!

Follow MindStick