title: Opening a facebook web profile via facebook app doesn't always work
body: <h2>Background</h2>
  
  <p>i'm trying to open a specific profile page on the facebook app (when facebook app is installed of course).</p>
  
  <h2>The problem</h2>
  
  <p>I've noticed that if I, as an end user, go to the app info screen (where i can uninstall the app, clear its cache etc...) of facebook app and choose "force stop", and then try to open the profile page, the facebook app itself either crashes or doesn't even start.</p>
  
  <p>if the facebook app was already running, the code works fine.</p>
  
  <h2>The code</h2>
  
  <pre><code>context.getPackageManager().getPackageInfo("com.facebook.katana", 0);
  final String facebookScheme = String.format("fb://profile/%s", socialNetworkUid);
  final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(facebookScheme));
  intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_HISTORY
          | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
  return intent;
  </code></pre>
  
  <p>BTW, the scheme was found from <a href="https://stackoverflow.com/a/6638342/878126"><strong>this link</strong></a>.</p>
  
  <h2>The question</h2>
  
  <ul>
  <li>why does it occur?</li>
  <li>can i somehow avoid it? </li>
  <li>is it a bug on facebook app or maybe i didn't implement it correctly?</li>
  <li>do I really need now to check if FB app is active and only then allow to use this intent? if so, how?</li>
  </ul>