3
这看起来很简单,但我不知道如何去做。意向过滤器只匹配域(没有路径)
我需要我的应用程序在用户点击域名网址时打开。 我需要匹配没有路径的域(android:host)的URL。 example.com或example.com/
我得到它的工作example.com/(带斜杠),但没有斜杠我永远不能捕捉到的网址: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/
这不起作用。没有路径参数时,只匹配'http:// example.com /',而不是'http:// example.com'(通过'adb shell start'测试) –