Kurniawan Alcantara
Kurniawan Alcantara

Reputation: 595

Android Studio generates three separate apps after I compiled and ran in the android emulator

I have upgraded my Android studio. I think there is something different from the previous version When I finished writing the code and compile then run. I look something different like this:

enter image description here

Whether it's something new or I destructive my android studio settings

Upvotes: 1

Views: 50

Answers (2)

Hitesh Sarsava
Hitesh Sarsava

Reputation: 680

this is happening because you have posted below code in three different activities in AndroidManifest.xml file.

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

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

the mistake you have done is like below in AndroidManifest.xml file:

<activity
     android:name=".SplashActivity"
     android:launchMode="singleTop"
     android:screenOrientation="sensorPortrait">
        <intent-filter>
              <action android:name="android.intent.action.MAIN" />

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

<activity
     android:name=".HomeActivity"
     android:launchMode="singleTop"
     android:screenOrientation="sensorPortrait">
        <intent-filter>
              <action android:name="android.intent.action.MAIN" />

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

<activity
     android:name=".MainActivity"
     android:launchMode="singleTop"
     android:screenOrientation="sensorPortrait">
        <intent-filter>
              <action android:name="android.intent.action.MAIN" />

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

Upvotes: 0

Harish Rawal
Harish Rawal

Reputation: 236

May be you create multiple intent-filter in android AndroidManifest.xml.

Upvotes: 1

Related Questions