title: ActivityNotFoundException handling
body: <p>I haven't done exception handling in a few years and I can't seem to figure out what I'm doing wrong. I have an app that opens another one of my apps and if the user doesn't already have the other app I want the current one to redirect to the Play Store. Right now if the app isn't installed the program is force closing. My current code is: </p>
  
  <pre><code>try{
      Intent intent = new Intent();
      PackageManager manager = getPackageManager();
      intent = manager.getLaunchIntentForPackage("my.app.package");
      intent.addCategory(Intent.CATEGORY_LAUNCHER);
      startActivity(intent);
     }
  catch(ActivityNotFoundException activityNotFound){
      Intent playStoreIntent = new Intent(Intent.ACTION_VIEW, 
      Uri.parse("market://details?id=my.app.package"));
      startActivity(playStoreIntent);
     }
  </code></pre>
  
  <p>I have a feeling I'm doing something really stupid and misuing the <code>catch</code> function. Any help would be much appreciated. </p>