如何在Android意向过滤器中执行否定匹配? [英] How can I perform a negative match in Android intent filter?
问题描述
在Android清单中,如何在android:pathPattern
中使用否定匹配?
如果可能的话,我想使用一个pathPattern
来匹配所有URL 上的特定主机名.
看来这是不可能的-实际上,似乎不是 这样设计的.我怀疑<intent-filter>
对于您尝试做的事情都是错误的工具.
即使您可以使用android:pathPattern
指定主机名(不是android:host
的目的吗?),它也不是正则表达式,而是glob.根据 docs 的说法,出于安全原因,该功能故意不足.>
In an Android manifest, how can I use a negative match in the android:pathPattern
?
I'd like to use a pathPattern
that matches on all URLs except for a specific hostname, if it's possible.
It doesn't look like that's possible--in fact, it seems to be designed not to work that way. I suspect <intent-filter>
is the wrong tool for whatever you're trying to do.
Even if you could use android:pathPattern
to specify the hostname (isn't that what android:host
is for?), it's more of a glob than a regex; according to the docs, it's deliberately underpowered for security reasons.
这篇关于如何在Android意向过滤器中执行否定匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!