0

实际上,我正在尝试通过 Uri 意图从“应用程序 A”启动“应用程序 B”,但是当我最小化应用程序时,它会在与“应用程序 A”相同的过程中打开,它在后台仅显示一个应用程序“应用 A" & "应用 B" 正在该过程中加载。

从“App A”启动“App B”的代码

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

应用内 B 清单文件

 <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>

它启动了第二个应用程序 B,但是当我最小化时过程将相同,我不会在后台看到两个应用程序,它仅在后台显示应用程序 A 并在其中加载应用程序 B。

如何获得 App A 和 App B 的两个独立进程?

4

1 回答 1

0
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);
于 2018-10-11T10:18:21.120 回答