I feel dumb for having to ask this but I cannot find how to take UI information from multiple EditText views and place in an email body. FYI I have the intent down, I just want to populate the message body.
Intent buildingfireemail = new Intent(android.content.Intent.ACTION_SEND);
buildingfireemail.setType("plain/text");///.setType("message/rfc822")
buildingfireemail.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"to@email.com"});
buildingfireemail.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
buildingfireemail.putExtra(android.content.Intent.EXTRA_TEXT, "Text"
//////////////I need to add data from 80+ views into here.
);try {
startActivity(Intent.createChooser(buildingfireemail, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(BuildingFireActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
Create a function which returns the whole String from all your text edits. For example:
Use like:
Init member variables for class:
Take all edit texts to member variables in onCreate after setContentView: