title: How to open my application when app link is clicked?
body: <p>What I want is to share the link of specific page of my application. Suppose I am in a profile page of some user in my app and I want to share that user to some of my friends so I would like to share it via WhatsApp and other applications.</p>
  
  <p>So basically I want to share a link to my app.</p>
  
  <p>This is what I am doing right now</p>
  
  <pre><code>Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
      shareIntent.setType("text/plain");
      shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "https://play.google.com/store/apps/details?id=" + activity.getPackageName());
      activity.startActivity(Intent.createChooser(shareIntent, "Share"));
  </code></pre>
  
  <p>I know this is not what I really want but it's partially done.
  if user hasn't installed my app then this code redirect him to google play store page to download this app.</p>
  
  <p>Main problem is when user have already this app this link just opens the app. I want to redirect user to that specific page when he clicks on a link.</p>
  
  <p>How can I do this?</p>
  
  <p>I heard something about <code>intent-filter</code> but not sure how to use them.</p>
  
  <pre><code>&lt;intent-filter&gt;
  &lt;action android:name="android.intent.action.VIEW" /&gt;
  &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
  &lt;data android:mimeType="application/pdf" /&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>UPDATED</strong></p>
  
  <p>Now I am trying to share my app link like this</p>
  
  <pre><code>Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
      shareIntent.setType("text/plain");
      shareIntent.putExtra("PostID", postID);
      shareIntent.putExtra("UserID", userID);
      shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "https://play.google.com/store/apps/details?id=" + activity.getPackageName());
      activity.startActivity(Intent.createChooser(shareIntent, "Share"));
  </code></pre>
  
  <p>Inside my manifest I have declared an activity like this</p>
  
  <pre><code>&lt;activity
          android:name=".activities.ShareActivity"
          android:screenOrientation="sensorPortrait"
          android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"&gt;
  
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.SEND" /&gt;
  
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
  
              &lt;data
                  android:host="details"
                  android:scheme="market" /&gt;
              &lt;data
                  android:host="play.google.com"
                  android:pathPattern="/store/apps/details?id=my_package_name"
                  android:scheme="http" /&gt;
              &lt;data
                  android:host="play.google.com"
                  android:pathPattern="/store/apps/details?id=my_package_name"
                  android:scheme="https" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>But I am still not able to see my app when I click on the link I shared using WhatsApp or any other means.</p>
  
  <p>Please help me</p>
  
  <p>Any help will be really appreciated.
  Thanks in advance.</p>