Android intent filter data path example

Casebash picture Casebash · Aug 24, 2010 · Viewed 8.5k times · Source

I tried using the following data in my intent filter:

<data android:scheme="http" android:host="an.example.i.p" android:pathPrefix="t" />

Why doesn't the following url trigger it?

http://an.example.i.p/t/v2.aspx/chase/a.test.auto

Answer

Rich Schuler picture Rich Schuler · Aug 24, 2010

Try android:pathPrefix="/t". The IntentFilter calls Uri#getPath and pass the resulting string to the PatternMatcher and Uri#getPath returns with the starting /.