I\'m using Intent.ACTION_SEND
to send an email. However, when I call the intent
it is showing choices to send a message, send an email, and also to
public class MainActivity extends AppCompatActivity {
private EditText edt_email;
private Button btn_send;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
edt_email = (EditText) findViewById(R.id.edt_email);
btn_send = (Button) findViewById(R.id.btn_send);
btn_send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_SEND );
intent.putExtra(Intent.EXTRA_EMAIL , new String[]{"sanaebadi97@gmail.com"});
intent.putExtra(Intent.EXTRA_SUBJECT , "subject");
intent.putExtra(Intent.EXTRA_TEXT , "My Email Content");
intent.setType("message/rfc822");
startActivity(Intent.createChooser(intent , "Choose Your Account : "));
}
});
}
}