android - 从我的应用程序启动电子邮件客户端(android)

标签 android android-intent

嗨,我使用了以下代码来启动电子邮件客户端,但它仅启动消息应用程序...所以应该在此代码中修改哪些内容...

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {"<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="403627332c6e2d212e2a3500272d21292c6e232f2d" rel="noreferrer noopener nofollow">[email protected]</a>"});
emailIntent.setType("text/plain");
startActivity(Intent.createChooser(emailIntent, "Send a mail ..."));

最佳答案

代码 fragment 看起来不错。 在实际设备上尝试一下,应该可以正常工作。

关于android - 从我的应用程序启动电子邮件客户端(android),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4242672/

相关文章:

c# - 从无处获取 Firebase 异常

Android C2DM 注册 ID

java - Android Studio 如何检查 ImageView 是否已经显示图像,如果是则禁用 Intent

java - 新的 Intent (上下文,类)抛出 NullPointerException

Android getIntent 获取旧数据而不是新数据

java - Android:需要用户交互/输入的通知

抛出异常时Android CoroutineWorker重试

android - Dagger 2 的单例共享首选项

java - onActivityResult() 和 : failure delivering result resultinfo who=null request=1 result=-1 data=intent (has extras)

android - 尝试转到新的Intent时,Android App崩溃