
Here user has to enter his/her Name, age and message. It has to open Gmail app, showing entered name/age/message. Its showing only MESSAGE. Remaining details I’m not getting it.
String s1= name.getText().toString();
String s2= age.getText().toString();
String s3= msg.getText().toString();
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL,
new String[] { "abc@gmail.com" });
email.putExtra(Intent.EXTRA_SUBJECT,"hiiiii");
email.putExtra("Name", s1);
email.putExtra("Age", s2);
email.putExtra(Intent.EXTRA_TEXT, s3);
email.setType("message/rfc822");
startActivity(Intent.createChooser(email,"Choose an Email client :"));
Thats because the type EMAIL doesn’t have a concept for Name or Age. Emails contain only recepients, senders, Messages, and Subjects. You’ll have to concatenate your name and age data and put it in either the subject or message. Something like this would work:
This will put the name and age on their own line line the body(message) of the email.