android - 带有 intent-filter 参数的 pathPattern

标签 android android-intent android-manifest intentfilter

我希望我的应用程序继续一些网络链接。我在 list 中为此添加了 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>

它有效。但后来我被要求只处理那些指定了精确参数的 url。所以,我像这样更改了 pathPattern:

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

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

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

最佳答案

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

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

关于android - 带有 intent-filter 参数的 pathPattern,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21043635/

相关文章:

android - AAPT:错误:在调试 list 中找到未知元素 <uses-feature>

java - 获取相对于 View 的触摸坐标(ScreenToClient 等效?)

android - locationClient.requestLocationUpdates 不会触发 Kitkat 中的 Pending Intent

android - 如何以编程方式设置默认应用启动器?

android - 当按下后退按钮时,android显示空白页

android - 如何知道用户何时打开/关闭移动数据或 WiFi?

android - 如何在 Android 设备本地的终端仿真器中运行 "adb shell"命令?

android - 如何在自定义 View 中获取android默认属性

android - 使用 Intent Android 获取 url

android - 具有特定格式的深度链接