2

我有这个发送电子邮件的代码:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{MyApp.sInstance.ErrorsMail});
intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.Proposal));
//intent.setType("plain/text");
intent.setType("message/rfc822");
startActivity(Intent.createChooser(intent, getString(R.string.SendEmail)));

不幸的是,它不仅向我展示了电子邮件应用程序:Skype、FTP、GoogleDrive、GMail

如何将列表限制为电子邮件客户端?

更新:

添加

intent.setData(Uri.parse("mailto:"));

我收到:“没有应用程序可以执行此操作”。

4

1 回答 1

1

Actually, in your Intent..

ACTION_SEND is a generic Intent action that can be supported by any application that wants to. All you do is indicate what data you are sharing and the MIME type of that data -- from there, it is up to the user to choose from available activities.

The only way is some hack for use Explicit Intent with actual know of PackageName for the Email Application, and what type of ACTION it responses.

于 2012-05-18T06:53:26.287 回答