Wednesday, 19 June 2013

how to make an Activity a main luncher ?

go to AndroidManifest.xml  in your project and show it in xml view

search for target activity to be a main luncher and add the following tag

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

for example:


 <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.LoginActivity"
            android:label="@string/app_name"
             <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

No comments:

Post a Comment