Reputation: 4090
I have a basic handler set up to call the email application in the emulator and send an email. I've set up the email app in the emulator with my info so it's ready to go. However, when I click the button in my app to bring up a compose window I get the prompt that says: "No applications can perform this action"
Is this just something you can't do with the emulator?
private OnClickListener submitBtn = new OnClickListener(){
public void onClick(View v){
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
String emailTo = "[email protected]";
String emailSubject = "Subject";
String emailBody = "Some HTML goes here.";
emailIntent.setType("text/html");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,emailTo);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,emailSubject);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(emailBody));
startActivity(Intent.createChooser(emailIntent, "Send email in:"));
}
};
Upvotes: 1
Views: 2082
Reputation: 6928
I was able to make it work in the emulator by configuring the basic email app with a valid email address.
Upvotes: 0
Reputation: 5747
Add
intent.setType( "message/rfc822" );
or
intent.setType( "text/html" );
This will cause Android to show a chooser to the user for all applications that can send these types of messages. The html option may put up non-email apps so I use the rfc822 option.
Upvotes: 1
Reputation: 550
Try a third party app such as K9Mail http://code.google.com/p/k9mail/
The code looks fine, you're hitting some emulator limitations...
Upvotes: 0