Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 431
Mark McDonald Avatar asked Oct 15 '25 18:10

Mark McDonald


1 Answers

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.

like image 180
Alan Moore Avatar answered Oct 18 '25 08:10

Alan Moore



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!