user2951
user2951

Reputation: 67

Deeplinking - app listed twice

I'm having an issue with deeplinking in my application. When I click a url from my email and it prompts me to choose an application to open the link with, my app is listed twice. One version works and the other does not. Any suggestions?

Here's the snippet of code I think could be the issue:

<application
    android:name="com.test.TestApplication"
    android:allowBackup="true"
    android:fullBackupContent="@xml/backup_rules"
    android:resizeableActivity="false"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name="com.test.activity.LoginActivity"
        android:configChanges="orientation"
        android:launchMode="singleTop"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustResize" />
    <activity
        android:name="com.test.activity.HomeActivity"
        android:configChanges="orientation"
        android:launchMode="singleTop"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.MenuDrawer">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>

Upvotes: 1

Views: 1189

Answers (1)

droidpl
droidpl

Reputation: 5892

When an intent is sent to the system to open another activity, the system applies the rules specified here to find which activities/services can receive that intent. If there is more than one activity there, then the user will be prompted with all the matching activities. In this case what you experience is that the intent sent can be received (based on intent filters) by multiple activities, depending on how it is defined in your manifest.

Upvotes: 2

Related Questions