title: Android - Share custom link via facebook
body: <p>I need to share specific part in my app when user open it , if he download my app it navigate direct to this part (it may be nested fragment).</p>
  
  <pre><code>String AppURL = "https://play.google.com/store/apps/details?id=" + getApplicationContext().getPackageName();
  String urlToShare = "http://stackoverflow.com/questions/7545254"; // I need custom url to specific part in my app 
  
  // See if official Facebook app is found
  boolean facebookAppFound = false;
  List&lt;ResolveInfo&gt; matches = getPackageManager().queryIntentActivities(intent, 0);
  for (ResolveInfo info : matches) {
      if (info.activityInfo.packageName.toLowerCase().startsWith("com.facebook.katana")) {
          intent.setPackage(info.activityInfo.packageName);
          facebookAppFound = true;
          break;
      }
  }
  
  // As fallback, launch sharer.php in a browser
  if (!facebookAppFound) {
      String sharerUrl = "https://www.facebook.com/sharer/sharer.php?u=" + urlToShare;
      intent = new Intent(Intent.ACTION_VIEW, Uri.parse(sharerUrl));
  }else{
  
  Intent intent = new Intent(Intent.ACTION_SEND);
  intent.setType("text/plain");
  // intent.putExtra(Intent.EXTRA_SUBJECT, "Foo bar"); // NB: has no effect!
  intent.putExtra(Intent.EXTRA_TEXT, urlToShare);
  }
  
  startActivity(intent);
  </code></pre>
  
  <p>here is what I need to approach </p>
  
  <p><a href="https://i.stack.imgur.com/SvQTj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SvQTj.jpg" alt="enter image description here"></a></p>