I want to set up an intent filter to handle urls like: http://mysite.com/?action=delete&id=30492
I've tried setting up my intent-filter
as follows:
<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="mysite.com" android:pathPrefix="/?action="/>
</intent-filter>
However, this doesn't work, and my app is not recognized as being able to handle the URL. I know that it's because I'm doing something wrong with my pathPrefix
because when I remove the pathPrefix
it works. I also know that it's related to having the question mark in there because if I remove the question mark from the URL and the pathPrefix
, it works.
Do I need to escape the question mark in some way? I tried escaping with a slash (android:pathPrefix="/\?action="
) but that doesn't work either.
How can I get this intent filter to work?