开发者

Email sending Java, Android

开发者 https://www.devze.com 2023-03-26 06:22 出处:网络
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.

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

精彩评论

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