开发者

Open Email Application in Android

开发者 https://www.devze.com 2023-01-22 08:03 出处:网络
I have a textView of text email id, when I click the ema开发者_Go百科il id, I want to open a email app which is located in the device, and in the \"To\" address bar should be filled with the clicked e

I have a textView of text email id, when I click the ema开发者_Go百科il id, I want to open a email app which is located in the device, and in the "To" address bar should be filled with the clicked email id.


maybe this will help

final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);

emailIntent .setType("plain/text");
emailIntent .putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"webmaster@website.com"});
emailIntent .putExtra(android.content.Intent.EXTRA_SUBJECT, mySubject);
emailIntent .putExtra(android.content.Intent.EXTRA_TEXT, myBodyText);

context.startActivity(Intent.createChooser(intent, "Send mail...));

stolen from link

0

精彩评论

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