• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

SOLVED Multiple launchers per app

D

Deleted User

Guest
I wrote a simple app that has two activities and a launcher for each activity, following the video
. After installing on my phone with Android Studio (Run / Debug 'app'), both launchers show up in my app list, the main launcher correctly brings up the first activity, but the second launcher also brings up the first activity. What am I missing, here, to get the second launcher to launch the second activity of my app? Here is my AndroidManifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.systemsolutionsrd.btlos">

<application
android:allowBackup="true"
android:icon="@Mipmap/ic_launcher_main"
android:label="@String/app_name"
android:roundIcon="@Mipmap/ic_launcher_main_round"
android:supportsRtl="true"
android:theme="@Style/Theme.BtLos">
<activity
android:icon="@Mipmap/ic_launcher_main2"
android:label="@String/main2_label"
android:name=".MainActivity2"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:icon="@Mipmap/ic_launcher_main"
android:label="@String/main_label"
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

</manifest>
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones