Clicking on a link should pop my application

142 Views Asked by At

Right now, I'm using android:ssp to filter the path of url and this is available from API 19.

How do I filter the url path for API 10 onwards?

scheme://host/path/token 

is my url pattern.

EDIT:

I have tried android:path="/path/*" but it isn't working

2

There are 2 best solutions below

0
On BEST ANSWER
<intent-filter>
<data android:scheme="scheme" android:host="host" /></intent-filter>

The way I'm trying to implement may cause this error

Finally decided not use path, filtering using host and handling it with the data in my activity.

2
On

You can simply use an intent filter on the same activity that uses the data element to filter on the Uri. You can add this filter after your ssp filter on the same activity.

I think the correct intent filter would look something like this:

<intent-filter>
    <data android:scheme="scheme" android:host="host" android:path="path/*" />
</intent-filter>

Edit:

From the linked documentation:

Note: A path specification can contain a wildcard asterisk (*) to require only a partial match of the path name.

So this allows you to use an asterisk in your path for the token.