Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/178.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android应用程序电子邮件撰写-如何自动;“发送”;电子邮件_Android_Email - Fatal编程技术网

android应用程序电子邮件撰写-如何自动;“发送”;电子邮件

android应用程序电子邮件撰写-如何自动;“发送”;电子邮件,android,email,Android,Email,我正在尝试在我的表上的android应用程序中使用本机电子邮件撰写,以便在应用程序崩溃时向我发送日志 下面的代码工作得很好,但是会弹出本机电子邮件,您必须按send。是否有一种方法可以告诉compose应用程序只发送电子邮件。无需手动点击即可发送 Intent intent = new Intent(Intent.ACTION_SENDTO); // it's not ACTION_SEND intent.setType("message/rfc822"); intent.setType(

我正在尝试在我的表上的android应用程序中使用本机电子邮件撰写,以便在应用程序崩溃时向我发送日志

下面的代码工作得很好,但是会弹出本机电子邮件,您必须按send。是否有一种方法可以告诉compose应用程序只发送电子邮件。无需手动点击即可发送

Intent intent = new Intent(Intent.ACTION_SENDTO); // it's not ACTION_SEND
 intent.setType("message/rfc822");

 intent.setType("text/plain");
 intent.putExtra(Intent.EXTRA_SUBJECT, "Subject of email");
 intent.putExtra(Intent.EXTRA_TEXT,    "Body of email");
 intent.setData(Uri.parse("myeamil@yahoo.com")); // or just "mailto:" for blank
 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // this will make such that when user returns to your app, your app is displayed, instead of the email app.
 //startActivity(intent);
谢谢。
Max

你应该试试看,或者了解更多细节

-我找到了这个,但它看起来像我需要的,但我不知道该如何称呼它。另一个的问题是你仍然必须按下一个发送按钮,我希望这会自动发生。我不明白为什么你必须按下一个发送按钮,上面的答案。你只需要创建一个线程并调用email.send()我想从我的应用程序的几个类中调用if。如果应用程序崩溃,我想向我发送日志文件。我想当你说email.send时,你是在说第二组代码。首先我得按一下按钮。我正在寻找一种方法,向gmail发送一个点击或命令,告诉它发送电子邮件,而不必在邮件出现时手动按下按钮