title: IntentChooser - different intents for different apps
body: <p>I've found <a href="https://stackoverflow.com/a/18068122/1192761">this</a> answer, which explains how to create a different intent for each app, but some why it does not work:</p>
  
  <p>here is the code that reproduces the issue, you can even comment the <code>if</code> and you will stick get the <code>text</code> and not the <code>twitter</code></p>
  
  <pre><code>public Intent getShareChooserIntent(Context context) {
      Intent basicIntent = new Intent();
      basicIntent.setAction(Intent.ACTION_SEND);
      basicIntent.setType("text/plain");
      basicIntent.putExtra(Intent.EXTRA_TEXT, "text");
      basicIntent.putExtra(Intent.EXTRA_SUBJECT, "subject");
      PackageManager pm = context.getPackageManager();
  
      Intent openInChooser = Intent.createChooser(basicIntent, "share");
      List&lt;ResolveInfo&gt; resInfo = pm.queryIntentActivities(basicIntent, 0);
      List&lt;LabeledIntent&gt; intentList = new ArrayList&lt;LabeledIntent&gt;();        
      for (int i = 0; i &lt; resInfo.size(); i++) {
         ResolveInfo ri = resInfo.get(i);
         String packageName = ri.activityInfo.packageName;
         Intent realIntent = new Intent();
         realIntent.setAction(Intent.ACTION_SEND);
         realIntent.setType("text/plain");
         realIntent.putExtra(Intent.EXTRA_TEXT, "text");
         realIntent.putExtra(Intent.EXTRA_SUBJECT, "subject");
  
         if (packageName.contains("twitter")) // !!!!THIS LINE!!!!
             realIntent.putExtra(Intent.EXTRA_TEXT, "twitter");
  
         intentList.add(new LabeledIntent(realIntent, packageName, ri.loadLabel(pm), ri.icon));
      }
  
      openInChooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentList.toArray( new LabeledIntent[ intentList.size()]));
      return openInChooser;
  }
  </code></pre>
  
  <p>what am I doing wrong? </p>