How to Launching an other app from an intent with different process?

722 Views Asked by At

Actually, I'm trying to launch "App B" From "App A" through Uri intent, but that opens up in the same process of "App A" when I minimize the app it shows only one app in the background that is "App A" & "App B" is loading in that process.

Code to Launch "App B" From "App A"

    Uri uri = Uri.parse("MyappB://pt?user=userID&pass=Password"); 
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(uri);
    startActivity(intent);

In-App B manifest file

 <activity android:name=".common.controller.ParseDeepLinkActivity">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                android:scheme="MyappB"
                android:host="pt"
                />
        </intent-filter>
    </activity>

it launches the Second App B but the process will be the same when I minimize, I won't see two apps in the background, it shows only App A in the background and loading App B in it.

How do I get the two separate process for App A & App B?

1

There are 1 best solutions below

1
On
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(ComponentName.unflattenFromString("MyappB://ptuser=userID&pass=Password"));
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);