HOW TO DEFINE AN ACTIVITY AS LAUNCHER ACTIVITY IN APPLICATION MANIFEST FILE?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
 793  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    How to define an Activity as launcher activity in application Manifest file?

    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>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!