pathPattern,其中包含intent-filter中的参数

时间:2014-01-10 11:50:56

标签: android android-intent android-manifest intentfilter

我希望我的应用程序继续进行一些网络链接。我在清单中为此添加了intent-filter。它看起来像这样:

<activity android:name=".SomeActivity">
    <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" android:host="*.something.com" />
        <data android:pathPattern="/.*/download/.*" />
    </intent-filter>
</activity>

有效。但后来我被要求只处理那些指定精确参数的网址。所以,我已经改变了pathPattern

<data android:pathPattern="/.*/download/.*param=.*" />

然后我尝试在浏览器网址中打开http://something.com/en/download/what?param=1234 但模式不起作用,我的应用程序不提供打开。

我对参数有疑问。可能pathPattern根本不看它们?或者我还做错了什么?

1 个答案:

答案 0 :(得分:6)

我知道它已经很晚了,但这可能会节省一些人的时间。

没有参数或查询字符串。 (因此,标记之后的部分根本不与任何东西匹配

相关问题