how to attach a String variable to an email
<p>In Android Studio I wish to send an email on a button click. I am using the following code till I work out what is going on before I start changing thing.</p>

<pre><code>    String[] TO = {"ABC@yahoo.com.au"};
    String[] CC = {"xyz@gmail.com"};
    Intent emailIntent = new Intent(Intent.ACTION_SEND);
    emailIntent.setData(Uri.parse("mailto:"));
    emailIntent.setType("text/plain");
    emailIntent.putExtra(Intent.EXTRA_EMAIL, TO);
    emailIntent.putExtra(Intent.EXTRA_CC, CC);
    emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Email subject");
    emailIntent.putExtra(Intent.EXTRA_TEXT, "Some message added in here");

    try {
        startActivity(Intent.createChooser(emailIntent, "Send mail..."));
        finish();
    } catch (android.content.ActivityNotFoundException ex) {
        Toast.makeText(MainActivity.this,
                "There is no email client installed.", Toast.LENGTH_SHORT).show();
    }
</code></pre>

<p>This works fine and well and shows up on my phone with the email content being as expected, however the email content, "Some message added in here" line is clearly hardcoded. I obviously wish to add in my own content by doing the following</p>

<pre><code>    String content = "Information I want to send";
    emailIntent.putExtra(Intent.EXTRA_TEXT, content);
</code></pre>

<p>But for some reason the email content is blank. Why does is a string "content" recognised but a String variable x is not?</p>