title: Android - No Activity found to handle Intent when opening FB native app
body: <p>I'm trying to open FB app on a specific post from a url received in a notification.</p>
  
  <p>It work perfectly on most devices but it crashes mostly on Samsung S7.
  My simple code:</p>
  
  <pre><code>String url = "fb://post/&lt;post_id&gt;";
  Uri target = Uri.parse(url);
  notifIntent = new Intent(Intent.ACTION_VIEW, target);
  startActivity(notifIntent);
  </code></pre>
  
  <p>I checked before that FB exists on the device:</p>
  
  <pre><code>PackageManager packageManager = context.getPackageManager();
  try {
       int versionCode = packageManager.getPackageInfo("com.facebook.katana", 0).versionCode;
       return "fb://post/" + fb_url;
  } catch (PackageManager.NameNotFoundException e) {
       return "https://www.facebook.com/" + fb_url; //normal web mUrl
  }
  </code></pre>
  
  <p>The error log:</p>
  
  <pre><code>Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{snip.snipnotifier/snip.snipnotifier.LoadingActivity}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=fb://post/&lt;post_id&gt; }
         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3149)
         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3248)
         at android.app.ActivityThread.access$1000(ActivityThread.java:197)
         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1681)
         at android.os.Handler.dispatchMessage(Handler.java:102)
         at android.os.Looper.loop(Looper.java:145)
         at android.app.ActivityThread.main(ActivityThread.java:6872)
         at java.lang.reflect.Method.invoke(Method.java)
         at java.lang.reflect.Method.invoke(Method.java:372)
         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
  Caused by android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=fb://post/251996958535784_295668917501921 }
         at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1817)
         at android.app.Instrumentation.execStartActivity(Instrumentation.java:1515)
         at android.app.Activity.startActivityForResult(Activity.java:4076)
         at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:48)
         at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:75)
         at android.app.Activity.startActivityForResult(Activity.java:4023)
         at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:856)
         at android.app.Activity.startActivity(Activity.java:4347)
         at android.app.Activity.startActivity(Activity.java:4315)
         at snip.snipnotifier.LoadingActivity.onCreate(LoadingActivity.java:29)
         at android.app.Activity.performCreate(Activity.java:6550)
         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3102)
         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3248)
         at android.app.ActivityThread.access$1000(ActivityThread.java:197)
         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1681)
         at android.os.Handler.dispatchMessage(Handler.java:102)
         at android.os.Looper.loop(Looper.java:145)
         at android.app.ActivityThread.main(ActivityThread.java:6872)
         at java.lang.reflect.Method.invoke(Method.java)
         at java.lang.reflect.Method.invoke(Method.java:372)
         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
  </code></pre>
  
  <p>Would appreciate your help.</p>