Android 如何使用我的应用程序发送的电子邮件的价值打开Gmail应用程序并自动填写Gmail?
我正在创建一个应用程序,在其中查看某人的个人资料时,我希望在单击浮动操作栏后将用户发送到电子邮件Android 如何使用我的应用程序发送的电子邮件的价值打开Gmail应用程序并自动填写Gmail?,android,email,Android,Email,我正在创建一个应用程序,在其中查看某人的个人资料时,我希望在单击浮动操作栏后将用户发送到电子邮件 Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto","example@example.com", null)); emailIntent.putExtra(Intent.EXTRA_SUBJECT, "your subject here"); emailIntent.putExtra(I
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto","example@example.com", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "your subject here");
emailIntent.putExtra(Intent.EXTRA_TEXT, "if you want append some text");
startActivity(Intent.createChooser(emailIntent, "Send email..."));
我可以打开gmail,但我没有电子邮件的价值已经填写,尽管发送它的价值
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto","example@example.com", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "your subject here");
emailIntent.putExtra(Intent.EXTRA_TEXT, "if you want append some text");
startActivity(Intent.createChooser(emailIntent, "Send email..."));
代码:
fabtoemail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
String aEmail = email;
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, aEmail);
emailIntent.setType("plain/text");
startActivity(Intent.createChooser(emailIntent, "Select Application"));
}
});
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto","example@example.com", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "your subject here");
emailIntent.putExtra(Intent.EXTRA_TEXT, "if you want append some text");
startActivity(Intent.createChooser(emailIntent, "Send email..."));
像这样试试
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto","example@example.com", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "your subject here");
emailIntent.putExtra(Intent.EXTRA_TEXT, "if you want append some text");
startActivity(Intent.createChooser(emailIntent, "Send email..."));
虽然这段代码可能会回答这个问题,但您应该添加一个解释,说明为什么/如何解决这个问题。是的,我的错。我只是觉得那些台词不需要解释,但我想这不是这样思考的地方。