Android App activities installed as multiple icons

My Android App has 2 activities. A login screen and a search screen. When I deploy the app on emulator or on my device, I see 2 icons for same app. When I click on icon 1 it opens screen 1 (login screen) and When I click on icon 2 it opens screen 2 (search screen). By logic when I login it should show the search screen. Not sure when I'm making the mistake.


Solution 1:

Your manifest file should only have this line in the activity you want to have an icon:

<category android:name="android.intent.category.MAIN" />

Based on your description, it sounds like both activities have this line.

Solution 2:

In your mainfest file when you have following tag in two different activities tags at the time, Android app seems to be installed twice.

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