title: how to get list of installed instant messenger apps?
body: <p>My app should be able to send the text in a TextView via WhatsApp, Email, SMS etc. For that i need a list of installed Messging Applications. I tried it with the PackageManger but i get all apps. How can i get only the Instant Messaging Apps?</p>
  
  <p>This is my code to list the installed apps:</p>
  
  <pre><code>PackageManager packageManager=this.getPackageManager(); 
      List&lt;PackageInfo&gt; applist=packageManager.getInstalledPackages(0);
      Iterator&lt;PackageInfo&gt; it=applist.iterator();
      while(it.hasNext()){
      PackageInfo pk=(PackageInfo)it.next();
      if(PackageManager.PERMISSION_GRANTED==(packageManager.checkPermission(Manifest.permission.INTERNET, pk.packageName)&amp; packageManager.checkPermission(Manifest.permission.RECEIVE_SMS, pk.packageName))) //checking if the package is having INTERNET permission
      {
      myList.add(""+pk.applicationInfo.loadLabel(packageManager));
      }
      }
  </code></pre>