use <intent-filter>
DESCRIPTION:
Specifies the types of intents that an activity, service, or broadcast receiver can respond to. 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.
Most of the contents of the filter are described by its <action>
, <category>
, and <data>
sub elements.
Here is an example
<a href="http://stg.bbc.in/press-rel/abc.html">click me!</a>
AndroidManifest.xml
looks like this:
<activity
android:name=".DashBoard"
android:label="@string/title_activity_dash_board"
android:exported="true"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<data
android:host="www.bbc.in"
android:pathPrefix="/"
android:scheme="https" />
<data
android:host="www.stg.bbc.in"
android:pathPrefix="/"
android:scheme="http" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
Note: Order of the intent flags might cause a problem so use like above
"I suggest you simply make another <intent-filter>
with the new sub elements in that tag to avoid the problems" look here