Set As 1st Screen

How to set an activity as the main page on Android screen?


BY DEFAULT : MainActivity is the main page


AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.test2"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

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

</manifest>


The above example MainActivity will start first when Run



AndroidManifest.xml

To set SecondActivity to be the First Activity when Run, make the following changes:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.test2"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

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

</manifest>