Android 如何正确处理这一意图

Android 如何正确处理这一意图,android,android-intent,Android,Android Intent,我试图让用户在单击按钮时给我发送电子邮件,并使用此代码来执行此操作。虽然它可以工作,但它带来了许多其他无法处理电子邮件的应用程序,如Twitter和Facebook。少了什么 String[] email = {"evan@example.com"}; Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.setType("text/plain"); sendIntent.putExtra(Intent.EXTRA_EMA

我试图让用户在单击按钮时给我发送电子邮件,并使用此代码来执行此操作。虽然它可以工作,但它带来了许多其他无法处理电子邮件的应用程序,如Twitter和Facebook。少了什么

String[] email = {"evan@example.com"};

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("text/plain");
sendIntent.putExtra(Intent.EXTRA_EMAIL,email);
context.startActivity(sendIntent);
因此,您需要删除最后一行


请参见

Try似乎是修改emailIntent.setType(“text/plain”)的行的副本;到emailIntent.setType(“纯/文本”);
// start the activity
context.startActivity(sendIntent); 

// start the activity asking the user how to send the email
context.startActivity(Intent.createChooser(sendIntent, "Email:")); 
  final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
  emailIntent .setType("plain/text");
  emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"evan@example.com"});
  emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "My Subject");                 
    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, msg);
startActivity(Intent.createChooser(emailIntent, "Send mail"));