开发者

want to extract subject, to and body of an email from a text which are separated by :

开发者 https://www.devze.com 2023-03-29 23:59 出处:网络
This is the text message i got from my qrdecoder android application: SMTP:test@te开发者_运维知识库st.com:QR demo:Hi admin,

This is the text message i got from my qrdecoder android application:

SMTP:test@te开发者_运维知识库st.com:QR demo:Hi admin,
please find the attached
Thanks
test

i want to extract emailid, subject i.e QR demo and body of the message.

so that i can call an intent to send email.

{
Intent emailIntent = new Intent(Intent.ACTION_SEND);

String aEmailList[] = { "some_email@domain.com"};

emailIntent.putExtra(Intent.EXTRA_EMAIL, aEmailList);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Sample Subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "");

emailIntent.setType("message/rfc822");

startActivity(Intent.createChooser(emailIntent, "Select Email Application"));
}


Have a look at java.util.StringTokenizer class: http://developer.android.com/reference/java/util/StringTokenizer.html

0

精彩评论

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