我用下面这段代码的电子邮件发送。我在仿真器中出现错误,但它在真实设备上工作
Intent emailDeveloper = new Intent(Intent.ACTION_SEND);
emailDeveloper.setType("message/rfc822");
emailDeveloper.putExtra(Intent.EXTRA_EMAIL , new String[]{"[email protected]"});
emailDeveloper.putExtra(Intent.EXTRA_SUBJECT, "E-mail subject");
emailDeveloper.putExtra(Intent.EXTRA_TEXT , "Message text");
try
{
startActivity(Intent.createChooser(emailDeveloper, "Send e-mail..."));
}
catch (android.content.ActivityNotFoundException ex)
{
Toast.makeText(YourActivity.this, "Error finding E-mail application",
Toast.LENGTH_SHORT).show();
}
当我运行模拟器时,它不会让我调用电子邮件意图。它基本上说没有发现处理意图(不知道确切的味精)。它在实际设备上正常工作。 – Gophermofur