开发者

Email sending Java, Android

I create the app with button "Sending". When I pressed this button, the app must show me a list of email-clients from mobile. How do I make that? Thank you for, anyw开发者_如何学JAVAay.


Use intents. Check out the following code. It should do the trick.

String subject = "Subject text goes here.";
String body = "Body text goes here"
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text"); 
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);     
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, body);  
startActivity(Intent.createChooser(email, "Send Mail..."));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜