Launch view using different app launchers with two icons

I have designed an app using ionic 3 /cordova for android. I want multiple launchers that show different views of the ionic app. I have created launchers using AndroidManifest.xml and creating two activities

I have two icons which is what I want. Problem is, how to I get the second icon to launch the specific view I want in a separate instance of the same app? Thanks!

What does that mean? A launcher normally is the app running the homescreen on Android, isn’t it?


I want after installation of my application that two icons are created on the user’s phone menu each of these icons open to a module of the application

You said so before.

But I asked another question.

Yes that’s exactly it

Then your question doesn’t make sense. One can only run one launcher at a time on Android.

Please look page And

Sorry for my English I am francophone , I know how to do this so I’m talking to you about android studio may have found that when I generate an application on ionic cordova I only have one activity and those so I want is how can I specify another activity in my config.xml file.Please understand my problem?

Can you share your AndroidManifest.xml?

I think you will have to somehow find out which one of the icons was clicked and use that information to redirect to another screen.


<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0" package="" xmlns:android="">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
        <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="de.appplant.cordova.emailcomposer.EmailComposerProvider">
            <meta-data android:name="" android:resource="@xml/emailcomposer_provider_paths" />
        <provider android:authorities="${applicationId}.sharing.provider" android:exported="false" android:grantUriPermissions="true" android:name="nl.xservices.plugins.FileProvider">
            <meta-data android:name="" android:resource="@xml/sharing_paths" />
        <amazon:enable-feature android:name="" android:required="false" xmlns:amazon="" />
        <service android:exported="false" android:name="com.onesignal.ADMMessageHandler" />
        <receiver android:name="com.onesignal.ADMMessageHandler$Receiver" android:permission="">
                <action android:name="" />
                <action android:name="" />
                <category android:name="" />
        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/fb_app_id" />
        <meta-data android:name="com.facebook.sdk.ApplicationName" android:value="@string/fb_app_name" />
        <activity android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/fb_app_name" android:name="com.facebook.FacebookActivity" />
        <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="">
            <meta-data android:name="" android:resource="@xml/provider_paths" />
        <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="de.appplant.cordova.plugin.notification.util.AssetProvider">
            <meta-data android:name="" android:resource="@xml/localnotification_provider_paths" />
        <receiver android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.TriggerReceiver" />
        <receiver android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.ClearReceiver" />
        <activity android:exported="false" android:launchMode="singleInstance" android:name="de.appplant.cordova.plugin.localnotification.ClickReceiver" android:theme="@android:style/Theme.Translucent" />
    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="" />
    <permission android:name="" android:protectionLevel="signature" />
    <uses-permission android:name="" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

Can you highlight the code responsible for adding the two launcher icons?

Hello my friends the code that I use on Android studio for such architecture is:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""

        android:targetSdkVersion="27" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

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

        <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
        <activity android:name="com.projet.collecte.demo.activities.Connexion" />
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />

Why is this a different project? Where from was the AndroidManifest.xml you posted before?

Ok, so you are launching two different activities.
Does this work in an Ionic app? What exactly does it show?

For your idea to work, I think you would have to find out if the app was opened to com.projet.collecte.demo.activities.Lancement or com.projet.collecte.demo.MainActivity.

In fact my ionic only generates a main file that has the following code,

public class MainActivity extends CordovaActivity
    public void onCreate(Bundle savedInstanceState)

        // enable Cordova apps to be started in the background
        Bundle extras = getIntent().getExtras();
        if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {

        // Set by <content src="index.html" /> in config.xml

but my project is made up of two modules and I would like to have a manifesto that is eligible for the second AndroidManifest.xml

I would like to create an activity that opens a specific page in my project. Thanks again for your good understanding

Ok, so the AndroidManifest with 2 activities is not from your Ionic project?

Yes that’s precisely my problem

Manually you could duplicate the MainActivity to SecondActivity, then add something to the end of launchUrl. Also manually edit your AndroidManifest.xml so you have the second icon for that SecondActivity. Then find a way to read the param that you added to launchUrl in your app - probably easiest by adding some plain JS into your index.html and setting a global JS variable you can then read in your TS code.

thanks a lot for your help. I try your procedure

Thank you very much I found this link and I think it will help me

This doesn’t really sound related in any way to your goal. This is for opening an app via a link from a website or other apps, not from the Apps list or Homescreen.