title: How to choose my browser app as my default browser?
body: <p>So I made a nice app for web browsing and it works pretty well.
  When I launch my app, links are opened in my app and everything is going smoothly.
  However, when I click on a link from outside the app (in a text message for example), Android is asking me which browser to choose to open my link, and mine isn't listed.
  I'm trying to make my app able to open outside links and handle them.</p>
  
  <p>Thanks for your help!</p>
  
  <p><strong>EDIT : SOLVED</strong></p>
  
  <p>I found a way to make it work.
  Here is a snippet of my <strong>AndroidManifest.xml</strong></p>
  
  <pre><code>&lt;activity
          android:name=".MainActivity"
  
          &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;category android:name="android.intent.category.BROWSABLE" /&gt;
              &lt;data android:scheme="http" /&gt;
              &lt;data android:scheme="https" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>And here is how I retrieve and use the intent that started my app with a link :</p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>    @Override
  protected void onCreate(Bundle savedInstanceState) {
      //...
  
      Uri startIntentData = getIntent().getData();
      if(startIntentData!=null) {
          String intentUrl = startIntentData.toString();
          if(intentUrl.contains("http://")||intentUrl.contains("https://")) {  // checking if the intent's data was meant to be a url
              addTab(intentUrl); // a method that handle opening urls by calling webView.loadUrl(String url)
          }
      }
  </code></pre>
  
  <p>I don't know if it's the most secure or the most efficient way, but at least it works!</p>