Android: Separate intents for email & SMS
<p>I have an app that has two buttons – one for email &amp; one for SMS. Depending on the button pressed I want to email or else SMS a certain text. I have coded the email button and it is working fine. The problem is that the dialog box that pops-up gives an option of e-mail or Messaging the text. I want to separate out the two, so that when the user presses email, only the options of email is there, and when the user presses SMS, only the option of Messaging is there.</p>

<p>Here is the code that I have tried.</p>

<pre><code>private void sendEmail(){
    Intent i = new Intent(Intent.ACTION_SEND); 
    i.setType("text/plain"); 
    i.putExtra(Intent.EXTRA_EMAIL  , new String[]{"recipient@example.com"}); 
    i.putExtra(Intent.EXTRA_SUBJECT, "Subject of the message"); 
    i.putExtra(Intent.EXTRA_TEXT   , "Body of the message"); 
    try { 
        startActivity(Intent.createChooser(i, "Send mail...")); 
    } catch (android.content.ActivityNotFoundException ex) { 
        Toast.makeText(this, "There are no email clients installed.", Toast.LENGTH_SHORT).show(); 
    } 
}
</code></pre>

<p>Basically there seems to be a single intent  Intent.ACTION_SEND for both emails &amp; Messaging.   </p>

<p>Any way to separate them out?</p>
