0

I have two activities. When i mark my first activity as launcher(StartActivity) i get an error, but when i mark second activity(MainActivity) he works. Here is code:

<application
    android:allowBackup="true"
    android:icon="@drawable/buisness"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="MainActivity"
        android:label="@string/app_name" android:screenOrientation="portrait">          
    </activity>

    <activity
        android:name="StartActivity"
        android:label="@string/title_activity_start" android:screenOrientation="portrait">
        <intent-filter>
           <action android:name="android.intent.action.MAIN" />
           <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>   
    </activity>
</application>

In this variant i get error.

<application
    android:allowBackup="true"
    android:icon="@drawable/buisness"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="MainActivity"
        android:label="@string/app_name" android:screenOrientation="portrait">
        <intent-filter>
           <action android:name="android.intent.action.MAIN" />
           <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>          
    </activity>

    <activity
        android:name="StartActivity"
        android:label="@string/title_activity_start" android:screenOrientation="portrait">   
    </activity>
</application>

In this variant everything its OK.

nikitko43
  • 79
  • 1
  • 2
  • 3

0 Answers0