How can I perform a negative match in Android intent filter?

匿名 (未验证) 提交于 2019-12-03 01:03:01

问题:

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.

回答1:

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!