[英]Android no apps can perform this action
I have found two threads on the same topic with no solution that I can use, I am looking to click on an email address and automatically open an email app and send email, my code seems fine to me but I get the "No apps can perform this action" 我找到了同一主题的两个主题,没有我可以使用的解决方案,我希望点击一个电子邮件地址并自动打开一个电子邮件应用程序并发送电子邮件,我的代码似乎很好,但我得到“没有应用程序可以执行此操作“
This is the method I am using; 这是我正在使用的方法;
textView_emailid.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
textView_emailid.toString(), "your@email.com", null));
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, "Book an Appointment");
intent.putExtra(Intent.EXTRA_TEXT, "Hi " + name);
startActivity(Intent.createChooser(intent, "Send Email"));
}
});
Change your intent.setType("text/plain")
to intent.setType("message/rfc822")
. 将intent.setType("text/plain")
更改为intent.setType("message/rfc822")
。
Try the code snippet in this post directly without changing anything since it's the correct solution: https://stackoverflow.com/a/2197841/5250273 直接尝试此帖子中的代码段而不更改任何内容,因为它是正确的解决方案: https : //stackoverflow.com/a/2197841/5250273
If you still get "No apps can perform this action", then your device does not have any email application (since it may be rooted?). 如果您仍然收到“没有应用可以执行此操作”,那么您的设备没有任何电子邮件应用程序(因为它可能已植根?)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.