Title: Custom Intent for each app flavor?
Tags: android;android-intent
Question: Say I have app A and B. App B has multiple build flavors but each one is slightly different and I want to launch a specific flavor from app A.

I have considered using one custom shared intent but I don't want the OS to prompt the user about which version to use to handle the intent if they have multiple versions of B installed.

Is it possible to programatically define unique custom intents for each flavor of an application?

Comment: It is. Just define these intents in a manifest file for each flavor.

Here is the accepted answer: In order to use one shared AndroidManifest between multiple flavors and have unique intents for each I added a manifest placeholder for each flavor in build.gradle

```default {
    manifestPlaceholders = [uriPrefix: "myprefix"]
}
someFlavor{
    manifestPlaceholders = [uriPrefix: "otherprefix"]
}
```

In AndroidManfest.xml use a manifest placeholder like so in the intent filter:

```        <intent-filter&gt;
            <action android:name="com.custom.app.${uriPrefix}.SOME_ACTION" /&gt;
            <action android:name="android.intent.action.VIEW" /&gt;
            <category android:name="android.intent.category.BROWSABLE" /&gt;
            <category android:name="android.intent.category.DEFAULT" /&gt;
            <data android:scheme="${uriPrefix}" /&gt;
        </intent-filter&gt;
```



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:08/17/16', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<android><android-intent>', 'Title': 'Custom Intent for each app flavor?', 'ViewCount': 1290, 'id': 39007649, 'user_AboutMe': '<p>&quot;Out of all the things I have lost, I miss my mind the most&quot; - Mark Twain</p>\n', 'user_AccountId': 4377368.0, 'user_DisplayName': 'kira_codes', 'user_Reputation': 1389.0, 'user_Views': 116.0, 'user_id': 3570019.0}}