How to make a the links of my website in the Android browser start up my app but not when the link has a Certain part


I'm going to implement this scenario:

www. -> Start up my App

http:// -> Start up my App

http:// -> Start up my App

https:// -> Start up my App

https:// -> Start up my App


http:// -> Open the link in default browser.

by using intent-filter all the times it will open my app.

            <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" />
            <data android:scheme="https" />
            <data android:host="" />

Show source
| url   | java   | android   | website   | intentfilter   2017-01-07 17:01 1 Answers

Answers ( 1 )

  1. 2017-01-07 17:01

    One way to do it would be to open the browser directly in that case. Like this

    onCreate() {
      if(uri is in path we don't want) {
        open browser directly via intent
      //Handle a URL we do want

    To open the browser directly, you can figure out what the default browser is via How to find default browser set on android device and launch it explicitly.

◀ Go back