如何在 Android 中正确定义 2 个主要启动器活动

How to properly define 2 main launcher activities in Android

我的应用程序有 2 个主要启动器活动,它们都必须显示在应用程序系统抽屉中。

我的问题是,在第二个 activity 中定义 intent-filter 的正确方法是什么,所以它的优先级较低,操作系统会考虑第一个启动器 activity作为主要的。

现在两个activity都设置了next,但是我想知道有没有一种方法可以定义哪个是主要的,哪个比另一个更重要,或者在定义更多的时候有没有具体的细节1 主要 activity:

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

我知道有category.DEFAULT标志,但我不知道它的用途,添加时我看不出有什么区别:

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

最后,我在 Google 策略中找不到有关多个启动器活动的任何信息,但是在定义多个启动器活动时是否有任何策略或准则可遵循?

so it has less priority, and the operating system takes into account the first launcher activity as the main one

没有“主一”的概念。启动器如何选择对其可启动活动进行排序取决于启动器的开发人员。

I would like to know if there is a way to define which one is the main one with more importance over the other

不,抱歉。

I couldn't find any info about multiple launcher activities in Google policies, but is there any policy or guidelines to follow when defining more than one?

有关应用分发渠道政策的问题are considered to be off-topic for Stack Overflow。 FWIW,我不知道这里有任何限制,并且 Google 用于分发具有多个可启动活动的应用程序(特别是 Google 地图)。我不知道 Google 的当前应用程序是否提供多个启动器活动。