深层链接 - 应用列出两次
Deeplinking - app listed twice
我在应用程序中遇到深度linking 问题。当我从我的电子邮件中单击 url 并提示我选择一个应用程序来打开 link 时,我的应用程序被列出了两次。一个版本有效,另一个无效。有什么建议吗?
这是我认为可能是问题的代码片段:
<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>
当向系统发送打开另一个 activity 的意图时,系统会应用指定的 here 规则来查找哪个 activities/services 可以接收该意图。如果那里有多个 activity,则会提示用户所有匹配的活动。在这种情况下,您的体验是多个活动可以接收发送的意图(基于意图过滤器),具体取决于它在您的清单中的定义方式。
我在应用程序中遇到深度linking 问题。当我从我的电子邮件中单击 url 并提示我选择一个应用程序来打开 link 时,我的应用程序被列出了两次。一个版本有效,另一个无效。有什么建议吗?
这是我认为可能是问题的代码片段:
<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>
当向系统发送打开另一个 activity 的意图时,系统会应用指定的 here 规则来查找哪个 activities/services 可以接收该意图。如果那里有多个 activity,则会提示用户所有匹配的活动。在这种情况下,您的体验是多个活动可以接收发送的意图(基于意图过滤器),具体取决于它在您的清单中的定义方式。