Home > Blockchain >  How to properly define 2 main launcher activities in Android
How to properly define 2 main launcher activities in Android

Time:11-11

My app has 2 main launcher activities, which both must be shown in the apps system drawer.

My question is, what is the correct way to define the intent-filter in the second activity, so it has less priority, and the operating system takes into account the first launcher activity as the main one.

Right now I set next in both activities, but I would like to know if there is a way to define which one is the main one with more importance over the other, or if there are specific details when defining more than 1 main activity:

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

I know there is category.DEFAULT flag, but I don't know its purpose, and I see no difference when I add it:

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

And finally, 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?

CodePudding user response:

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

There is no concept of "main one". How a launcher chooses to order its launchable activities is up to the developers of the launcher.

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

No, sorry.

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?

Questions about policies for app distribution channels are considered to be off-topic for Stack Overflow. FWIW, I am not aware of any restrictions here, and Google used to distribute apps with multiple launchable activities (notably Google Maps). I do not know if any of Google's current apps offer multiple launcher activities.

  • Related