2

I know there are couple SO question about that generally but I can't find an answer and it's annoying that the docs don't have a couple of examples. It would be better if you could link me a guide. However my actual problem is the following:

What should the [<path>|<pathPrefix>|<pathPattern>] be in order to start my activity on:

http://www.example.com/e=VARIABLE

e.g.

http://www.example.com/e=foo
http://www.example.com/e=bar481

I have tried:

<data
    android:host="www.example.com"
    android:pathPattern="./e=.*"
    android:scheme="http" />

and

<data
    android:host="www.example.com"
    android:pathPattern="/e=.*"
    android:scheme="http" />

Also, I tried in the position of android:pathPattern, path and pathPrefix.

I assume that I can use the foo and the bar481 based on the second part here but I'm still struggling with starting the intent.

Docs: http://developer.android.com/guide/topics/manifest/data-element.html

Community
  • 1
  • 1
Diolor
  • 13,181
  • 30
  • 111
  • 179

1 Answers1

7

Solved it with:

<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="example.com" />
<data android:host="www.example.com" />
<data android:pathPrefix="/e=" />
Diolor
  • 13,181
  • 30
  • 111
  • 179
  • Thank you. This is the proper way to write intelligent intent filters that go to example.com/foo but not example.com/bar. For anyone else, when in doubt, separate your data items like this and make separate intent filters for different needs. Don't try and be clever and succinct, because this is not regex as you know it. – sbaar May 09 '15 at 01:28