如何让ImageButton在点击时直接打开电子邮件编辑器?
我为电子纸/电子杂志制作了一个应用程序,其中我想为电子邮件编辑器提供一个图像按钮,如果我单击该按钮,它将直接打开电子邮件编辑器,将该页面的所有数据插入到电子邮件编辑器消息正文中,仅询问收件人地址。
我有输出,但它没有打开电子邮件,而是打开弹出列表,询问消息传递和蓝牙。
这是我的代码:
final Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]" });
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "App Error Report");
emailIntent.putExtra(Intent.EXTRA_TEXT, "stacktrace");
activity(Intent.createChooser(emailIntent, "Send error report..."));
I have made one application for epaper/emagazine in which I want to give an imagebutton for email composer that if I click on that button it will directly open the email composer inserting all the data of that page to the email composer message body asking only recipient address.
I have the output but instead of email it opens popup list asking messaging and bluetooth.
This is my code:
final Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]" });
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "App Error Report");
emailIntent.putExtra(Intent.EXTRA_TEXT, "stacktrace");
activity(Intent.createChooser(emailIntent, "Send error report..."));
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
单击按钮时调用
sendEmail()
方法:定义
sendEmail()
方法:并在
AndroidManifest.xml
文件中设置权限:Call
sendEmail()
method on button click:Define the
sendEmail()
method:And set permission in
AndroidManifest.xml
file:使用意图我们不需要许可..
using intent we don't need permission..