I want to filter specific URL : http://gaapa.cz/mobile/*
But this filter is fired on every URl - ehta's wrong with that?
<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:host="gaapa.cz"
android:path="/mobile/.*"
android:scheme="http" />
</intent-filter>
Each intent filter specifies the type of intents it accepts based on the intent's action, data, and category. The system delivers an implicit intent to your app component only if the intent can pass through one of your intent filters.
However, since a component can have multiple intent filters, an intent that does not pass through one of a component's filters might make it through on another. An <intent-filter> element in the manifest file lists actions as <action> subelements. For example: <intent-filter . . . >
An intent filter declares the capabilities of its parent component — what an activity or service can do and what types of broadcasts a receiver can handle. It opens the component to receiving intents of the advertised type, while filtering out those that are not meaningful for the component.
Categories are used for implicit Intents. So, If your Activity can be started by an implicit Intent when no other specific category is assigned to activity, activity's Intent filter should include this category. (even if you have other categories in the Intent filter).
You want to either use path, pathPrefix
, or pathPattern
, according to the docs here.
In your case, either pathPattern
or pathPrefix
will work,
pathPattern="mobile/*"
or
pathPrefix="mobile"
However, that does not explain why your filter is matching all URIs. it should be matching none since path does not understand "*". i suspect there is something added / missing from somewhere else in your code.
Try this:
<data android:host="gaapa.cz"
android:pathprefix="mobile/"
android:scheme="http" />
This should work:
<data android:host="gaapa.cz"
android:path="mobile"
android:pathPattern="*"
android:scheme="http" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With