title: Filter out non-launchable apps when getting all installed apps
body: <p>Im working on a app where I want to present the user with all installed apps and let him/her choose one and then do something with it. I followed a tutorial (this: <a href="http://impressive-artworx.de/2011/list-all-installed-apps-in-style/">http://impressive-artworx.de/2011/list-all-installed-apps-in-style/</a> ) although I'm having some issues. After following the tutorial I only got apps that weren't preinstalled (like all background apps that aren't launchable) which is great if you want the apps that the user has downloaded from the play store. The problem is that in my app I want to display the launchable system apps like Youtube and Browser but not the non-launchable ones like Search Application Provider.</p>
  
  <p>Here's the code that I'm using when to get the apps:</p>
  
  <pre><code>private List&lt;App&gt; loadInstalledApps(boolean includeSysApps) {
    List&lt;App&gt; apps = new ArrayList&lt;App&gt;();
  
    // the package manager contains the information about all installed apps
    PackageManager packageManager = getPackageManager();
  
    List&lt;PackageInfo&gt; packs = packageManager.getInstalledPackages(0); //PackageManager.GET_META_DATA 
  
    for(int i=0; i &lt; packs.size(); i++) {
       PackageInfo p = packs.get(i);
       ApplicationInfo a = p.applicationInfo;
  
       App app = new App();
       app.setTitle(p.applicationInfo.loadLabel(packageManager).toString());
       app.setPackageName(p.packageName);
       app.setVersionName(p.versionName);
       app.setVersionCode(p.versionCode);
       CharSequence description = p.applicationInfo.loadDescription(packageManager);
       app.setDescription(description != null ? description.toString() : "");
       apps.add(app);
    }
    return apps;
    }
  </code></pre>
  
  <p>Now my question is; what is the best way to filter out the non-launchable apps?</p>
  
  <p>Any help is appreciated!</p>