Android – 尝试发送电子邮件时收到错误“无应用程序可以执行此 *** 作”?

Android – 尝试发送电子邮件时收到错误“无应用程序可以执行此 *** 作”?,第1张

概述我正在制作一个应用程序,我将向我的客户提供反馈功能.为了实现这一点,我创建了一个小对话框,用户可以在其中输入反馈并将其发送到我的邮件ID.我尝试了一些我在互联网上发现的代码片段,但是每当我尝试从仿真器或实际设备发送电子邮件时,我都会发现错误“无应用程序可以执行此 *** 作”. 这是我的代码: public void emailDialog(){ AlertDialog.Builder aler 我正在制作一个应用程序,我将向我的客户提供反馈功能.为了实现这一点,我创建了一个小对话框,用户可以在其中输入反馈并将其发送到我的邮件ID.我尝试了一些我在互联网上发现的代码片段,但是每当我尝试从仿真器或实际设备发送电子邮件时,我都会发现错误“无应用程序可以执行此 *** 作”.

这是我的代码:

public voID emailDialog(){    AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);    alertDialog.setTitle("Feedback");    alertDialog.setMessage("Please tell us that what you feel about our product. If you are facing any problem or found any BUG then please report to us. Your revIEw is important to us. Thanks!!");    final EditText input = new EditText(this);    input.setlines(8);    alertDialog.setVIEw(input);    alertDialog.setPositivebutton("Ok",new DialogInterface.OnClickListener() {        public voID onClick(DialogInterface dialog,int whichbutton) {            String value = input.getText().toString();            String address = "[email protected]";            String subject = "FeedBack";            final Intent emailintent = new Intent(androID.content.Intent.ACTION_SEND);            emailintent.putExtra(androID.content.Intent.EXTRA_EMAIL,address);            emailintent.putExtra(androID.content.Intent.EXTRA_SUBJECT,subject);            emailintent.putExtra(androID.content.Intent.EXTRA_TEXT,value);            CompleteTaskManager.this.startActivity(Intent.createChooser(emailintent,"Send Email.."));        }    });    alertDialog.setNegativebutton("Cancel",new DialogInterface.OnClickListener() {      public voID onClick(DialogInterface dialog,int whichbutton) {        // Canceled.      }    });alertDialog.show();}

请帮忙.

解决方法 我想你需要设置intent对象的类型.你可以尝试以下几点吗?
emailintent.setType("message/rfc822");

要么

emailintent.setType("text/plain");
总结

以上是内存溢出为你收集整理的Android – 尝试发送电子邮件时收到错误“无应用程序可以执行此 *** 作”?全部内容,希望文章能够帮你解决Android – 尝试发送电子邮件时收到错误“无应用程序可以执行此 *** 作”?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1131823.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存