title: Android - check if Facebook app exists returns wrong result
body: <p>I'm opening links received in notifications in FB native app if it's installed on the app and in the browser otherwise, using this code:</p>
  
  <pre><code>PackageManager packageManager = context.getPackageManager();
  try {
      packageManager.getPackageInfo("com.facebook.katana", PackageManager.GET_ACTIVITIES);
      return context.getString(R.string.fb_app_prefix) + fb_url;
  } catch (PackageManager.NameNotFoundException e) {
      return context.getString(R.string.fb_site_prefix) + fb_url; //normal web mUrl
  }
  </code></pre>
  
  <p>It works on most devices (including the emulator), but in some of them it doesn't throw an error although the app isn't installed.</p>
  
  <p>What's wrong with my code?</p>
  
  <p>I can add the following code for every link I have but not sure it's "healthy":</p>
  
  <pre><code>Intent testIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(fb_app_url));
  if (testIntent.resolveActivity(packageManager) != null) {
      return fb_app_url;
  }
  </code></pre>