title: getPackageManager ().getInstalledPackages (PackageManager.GET_ACTIVITIES) returns null
body: <p>If I call</p>
  
  <pre><code>    PackageManager pm = getPackageManager () ;
      List&lt;PackageInfo&gt; pis = pm.getInstalledPackages (PackageManager.GET_PROVIDERS) ;
  </code></pre>
  
  <p>I get a list of installed packages, including any provivders they declare (i.e, with pis[i].providers possibly being non-null).</p>
  
  <p>However, if I include PackageManager.GET_ACITIVITIES among the flags, as in</p>
  
  <pre><code>    PackageManager pm = getPackageManager () ;
      List&lt;PackageInfo&gt; pis = pm.getInstalledPackages (PackageManager.GET_ACTIVITIES | PackageManager.GET_PROVIDERS) ;
  </code></pre>
  
  <p>I expect to get the "same" list of installed packages, but with pis[i].activities being non-null as well.  But I don't, I get an empty list.</p>
  
  <p>Is there something special about including PackageManager.GET_ACTIVITES among the flags that isn't mention in the <a href="http://developer.android.com/reference/android/content/pm/PackageManager.html#getInstalledApplications(int)" rel="nofollow noreferrer">documentation</a>?</p>
  
  <p>My current work around is to leave PackageManager.GET_ACTIVITIES out of the flags, then loop through the returned list as follows:</p>
  
  <pre><code>    for (PackageInfo pi : pis) {
          try {
              PackageInfo tmp = pm.getPackageInfo (pi.packageName, PackageManager.GET_ACTIVITIES) ;
              pi.activities = tmp.activities ;
              }
          catch (NameNotFoundException e) {
              Log.e (TAG, e.getMessage ()) ;
              }
  </code></pre>
  
  <p>But that seems like a real kludge.</p>
  
  <p>The only mention I could find of getInstalledPackages (PackageManager.GET_ACTIVITIES) returning an empty list is <a href="https://stackoverflow.com/questions/3455781/packagemanager-getinstalledpackages-returns-empty-list">here</a>, but the problem in that case seems to have been something about calling getInstalledPackages() outside the main application thread and that is not the situation in my case.</p>
  
  <p>p.s. this is the .602 VZW build of Gingerbread, in case that matters</p>