'I tried to use intent email in my small android project but its not working. Can anyone help me to find the error?

public void submit_order(View view) { //For ORDER button EditText name_var = (EditText) findViewById(R.id.name); field = name_var.getText().toString();

    Intent intent = new Intent(Intent.ACTION_SENDTO);                // only email apps should handle this
    intent.setData(Uri.parse("mailto:"));
    intent.putExtra(Intent.EXTRA_SUBJECT, "Just Java order for " + field);
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
    display_message(field, number_of_coffee);
}


Solution 1:[1]

Add the email address in the mailto string, sir.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Richard Onslow Roper