title: Android PackageManger.getLaunchIntentForPackage() not throwing documented exception
body: <p>I try to get a launch intent from a third party package from the <code>PackageManager</code>. According to the documentation (<a href="http://developer.android.com/reference/android/content/pm/PackageManager.html#getLaunchIntentForPackage(java.lang.String)" rel="nofollow">http://developer.android.com/reference/android/content/pm/PackageManager.html#getLaunchIntentForPackage(java.lang.String)</a>), it throws a <code>PackageManager.NameNotFoundException</code> if the given package name cannot be found on the system and it returns <code>null</code> if the package does not contain a launch activity.</p>
  
  <p>When I try to catch the exception, I get a compilation error:</p>
  
  <pre><code>    PackageManager manager = getPackageManager();
      try{
          Intent launchAppIntent = manager.getLaunchIntentForPackage("somePackageName");
          //...
      } catch (PackageManager.NameNotFoundException exception){
  
      }
  </code></pre>
  
  <blockquote>
    <p>java: exception
    android.content.pm.PackageManager.NameNotFoundException is never
    thrown in body of corresponding try statement</p>
  </blockquote>
  
  <p>I think that one possibility might be that the behavior of that method changed and it returns always <code>null</code> instead of throwing an exception. But then, should I still wrap a try block around the call?</p>
  
  <p>How should I proceed solving that issue?</p>
  
  <p>I am currently building against Android 4.2.2.</p>