can you send an email with a direct suggestion of the Application, without opening an external application, type Gmail? Example:
A field where the person places the email and another field it per suggestion and a submit button. After all the pop-up when it hits the send button, does the email fire without opening the default email application that is set up on the smartphone?
I did a test with the code below, it works however it opens the external application.
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Envie sua sugestão para o nosso email", Snackbar.LENGTH_LONG)
.setAction("Enviar", new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent email = new Intent(Intent.ACTION_SEND);
email.setData(Uri.parse("mailto"));
email.setType("message/rfc822");
email.putExtra(Intent.EXTRA_EMAIL,
new String[]{"aquieucolocomeuemaildecontato"});
email.putExtra(Intent.EXTRA_SUBJECT,
"Sugestão: ");
email.putExtra(Intent.EXTRA_TEXT, "Olá " + "");
startActivity(Intent.createChooser(email, "ENVIAR E-MAIL"));
}
}).show();
}
});
}