SparkyNZ
SparkyNZ

Reputation: 6676

Android: Matching host pattern in an Intent Filter

I have the following URL:

http://api.modarchive.org/downloads.php?moduleid=50479#ngs_cvrg.xm

What I would like to do is match all .php URLs which contain 'mod' in the hostname. android:host will only allow 1 wildcard and I need 2.

I have tried modifying android:pathPattern instead as follows:

<data android:pathPattern=".*mod.*\\.php"/>

What is wrong with the above statement?

If I were to write a 'normal' file wildcard for doing this, I would be using:

 *mod*.php 

..but Android pathPattern syntax is different.

It would seem that what I am trying to do isn't possible:

"The URL consists of four parts: it has each of the four properties scheme, host, port, path corresponds to the URI part.

       For example: content://com.wjr.example1:121/files

       Part scheme: content
       Part host: com.wjr.example1
       Part port: 121
       Part path: files 
"

So.. how can I match any host containing "mod" (e.g. mods, modules, modarchive, modheaven etc) ?

Upvotes: 1

Views: 729

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317467

You can't do this. Presumably this prevents any app from registering essentially "bulk" interceptors for URLs and confusing users who might see some strange app asking to handle all sorts of URLs. You'll have to register each one by specific name.

Upvotes: 1

Related Questions