我的 Intent 过滤器看起来像这样:
<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="*"
android:host="*"
android:pathPattern="/pickup.jsp\?h=.+&p=.*&l=-?[0-9]+" />
</intent-filter>
我在 eclipse 中遇到解析器错误:
[com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper]
Parser exception for C:\projects\myapp\AndroidManifest.xml:
The reference to entity "p" must end with the ';' delimiter.
我正在尝试使用正则表达式为任何方案和任何主机匹配 URL /path/pickup.jsp?h=handle&p=&l=4234
。那可能吗?如果是这样,我将如何匹配它?
最佳答案
I'm trying to match the URL /path/pickup.jsp?h=handle&p=&l=4234
那是不可能的。查询参数不是 Uri
的一部分来自 <intent-filter>
立场,因此无法匹配。
关于android Intent 过滤器模式匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15301117/