Search code examples
androidandroid-intentintentfilter

Android: Handling Links using IntentFilter


I'm having a bit of trouble trying to handle the following link using an IntentFilter.

http://www.fakedomain.com/clubs/players/<playerId>/<hobbies>

And a real life example would something like as follows:

http://www.fakedomain.com/clubs/players/999/21321321321#xXtor=ZQA-999-[hobbies_hobby]

And this is my IntentFilter

<activity
    ......>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="http" android:host="www.fakedomain.com"
              android:path="/clubs/players/*" />
    </intent-filter>
</activity>

I have tried to following android:path's and none of them work:

android:path="/clubs/players/.*/.*"

android:path="/clubs/players/*/*"

I am able to handle the following link

http://www.fakedomain.com/clubs/players/

But this is useless since the link is missing the full path.

I have read through a few other examples that showed up from a google search but I'm still unable to handle the link, chances are I am doing something completely stupid.

Any help would be appreciated.


Solution

  • And this is my IntentFilter

    android:path does not accept wildcards. That is android:pathPattern. You may be better served using android:pathPrefix anyway.