Android的邮件选择器邮件、选择器、Android

由网友(可能因为我姓温而你喜欢冷)分享简介:我写一个应用程序,需要在每个事务结束时发送电子邮件。我做了以下内容:I am writing an app that needs to send emails at the end of each transaction. I am doing the following:Intent mail = new In...

我写一个应用程序,需要在每个事务结束时发送电子邮件。我做了以下内容:

I am writing an app that needs to send emails at the end of each transaction. I am doing the following:

Intent mail = new Intent(Intent.ACTION_SEND);
mail.setType("text/html");
mail.putExtra(Intent.EXTRA_EMAIL, new String[] { emailTo });
mail.putExtra(Intent.EXTRA_SUBJECT, "Send from Android");
mail.putExtra(Intent.EXTRA_TEXT, "Sent from Android");
startActivity(Intent.createChooser(mail,"Select Email Software..."));

我想这样做是pre-选择电子邮件软件并将其存储在一个设定。这样一来,该电子邮件被发送每次,它没有要求使用哪个电子邮件用户。我只是似乎无法弄清楚如何调用选择器,并获得选择的值。

What I would like to do is pre-select the email software and store it in a setting. That way, every time the email is being sent, it does not have to ask the user which email to use. I just can't seem to figure out how to invoke the chooser and get the selected value.

任何帮助将是很大的AP preciated。

Any help would be greatly appreciated.

推荐答案

您必须创建自己的选择器,这可能是一个 AlertDialog 使用调用的结果填充 queryIntentActivities() PackageManager

You would have to create your own chooser, possibly as an AlertDialog populated using the results of calling queryIntentActivities() on PackageManager.

阅读全文

相关推荐

最新文章