title: Open Android app from URL using intent-filter not working
body: <p>I have an Android app that people use as a replacement for a website. Hence, when users encounter an URL to the website, I want to give them the option to "open the URL" in my app instead of in the browser. In other words I want the popup to appear that lets them choose between my app and the browser (and possibly other apps).</p>
  
  <p>I understand from various sources that I need to add an intent filter to an activity in my app with the 'data' filter that filters on URLs of the correct form.</p>
  
  <p>The website in question is <a href="http://members.iracing.com">http://members.iracing.com</a>, hence I have added the following intent filter:</p>
  
  <pre><code>    &lt;activity
          android:name=".MainActivity"
          android:label="@string/title_activity_main" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.VIEW" /&gt;
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;data android:scheme="http" /&gt;
              &lt;data android:host="members.iracing.com" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>I have tried various forms of these data filters, like using a single 'data' node with both attributes:</p>
  
  <pre><code>        &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.VIEW" /&gt;
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;data android:scheme="http" android:host="members.iracing.com"/&gt;
          &lt;/intent-filter&gt;
  </code></pre>
  
  <p>It is simply not working. I don't know what else to tell you. I hosted a simple HTML page on my website with a couple links to various pages on that website (all starting with "http://members.iracing.com/...") and when I click any of them, they simply open in the browser without ever asking me which app I want to use. I tried it both on the emulator as well as after installing the app on my physical device, nothing works. I tried this in a completely BLANK, new Android project just to see if that would work, nothing. </p>
  
  <p>I then realized that the website requires authentication, and if you are not logged in it redirects to the login page at <a href="https://members.iracing.com/membersite/login.jsp">https://members.iracing.com/membersite/login.jsp</a>, hence I tried replacing the scheme by "https". I even tried changing the host to "www.members.iracing.com", and in the end I even tried a combination of all these things (not sure if this should work, but hey, I'm desperate at this point.....)</p>
  
  <pre><code>       &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.VIEW" /&gt;
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;data android:scheme="http" /&gt;
              &lt;data android:scheme="https" /&gt;
              &lt;data android:host="members.iracing.com" /&gt;
              &lt;data android:host="www.members.iracing.com" /&gt;
          &lt;/intent-filter&gt;
  </code></pre>
  
  <p>Still no go. I'm not sure if the redirect is relevant though, the browser clearly first goes to the non-redirected site, then does the redirect to the login page, but at no point do I get the choice to open it in my app. Furthermore, if I login manually in the browser first, there is no redirect, and it still does not work.</p>
  
  <p>Am I missing something obvious here? I'm pulling my hair out why this isn't working, and I cannot debug it besides trying every possible combination I could think of (I did...). Thanks for any help!</p>