【发布时间】:2016-10-17 11:24:38
【问题描述】:
这可能看起来很简单,但我还不知道该怎么做。
当用户单击域 url 时,我需要打开我的应用程序。 我需要将 URL 与没有路径的域 (android:host) 匹配。 example.com 或 example.com/
我让它在 example.com/ 上工作(带有斜杠),但我无法捕获没有斜杠的 URL:example.com
我尝试使用 pathPattern /*,它也不起作用。
以下是我的 Android 清单:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="example.com" />
<data android:host="www.example.com" />
<data android:pathPattern="/*" />
<data android:path="/" />
</intent-filter>
简单地说,我希望匹配带有或不带有斜杠“/”的 URL。 http://example.com http://example.com/
【问题讨论】:
标签: android android-manifest intentfilter