11

I'm trying to put together an intent filter to start my application when a certain HTML URL is accessed in the browser. I have no problems doing so when it's a standard url, like www.stonyx.com for example.

However, I need to match an URL with HTTP parameters like www.stonyx.com/?pagename and it's the part after the ? that I'm having trouble matching.

I've tried using android:path, android:pathPrefix, and android:pathPattern, and none of them seem to do it for me ... not sure if it's cause I'm doing something wrong or if it's just because it's a php path with a question mark. Any help is highly appreciated.

P.S. Here's what my intent filter looks like at the moment

<intent-filter>
  <action android:name="android.intent.action.VIEW"></action>
  <category android:name="android.intent.category.DEFAULT"></category>
  <category android:name="android.intent.category.BROWSABLE"></category>
  <data android:host="www.megaupload.com" android:scheme="http"></data>
</intent-filter>
Harry Muscle
  • 2,247
  • 4
  • 38
  • 62

1 Answers1

13

You can't. :(

according to http://developer.android.com/guide/components/intents-filters.html :

Each element can specify a URI and a data type (MIME media type). There are separate attributes — scheme, host, port, and path — for each part of the URI:

scheme://host:port/path

no parameters or query strings. (thus, the part after the ? mark is simply not matched against anything)

vmatyi
  • 1,273
  • 10
  • 21
  • 4
    Just want to let you know that if you do want to get the params, you can always parse it out of the "data" element, which will give you the entire URI. Use getIntent().getData() to get the URI. – PaulP May 29 '15 at 19:28