I want to Place content like
to the email content. how to do this...?
I tried this but not working.
Why not use a StringBuilder
to create all your content and then add it to your intent ?
StringBuilder sb;
sb.append("First Name : ");
sb.append(fname.getText().toString());
sb.append('\n');
sb.append("Last Name : ");
sb.append(lname.getText().toString());
sb.append('\n');
sb.append("Email : ");
sb.append(email.getText().toString());
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,sb);
You can simply do like this
String output = "FirstName :\nLastName :\nEmail ";
and add the string to the email content:
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, output);
Create a single String containing everything including "\n" for every line-break.
StringBuilder emailBody = new StringBuilder("First Name : ");
emailBody.append(fname.getText()).append("\n");
emailBody.append("Last Name : ").append(lname.getText()).append("\n");
emailBody.append("Email : ").append(email.getText());
emailIntent.putExtra(Intent.EXTRA_TEXT , emailBody.toString());