在Android App中单击按钮时如何打开Gmail Compose? [英] How to open Gmail Compose when a button is clicked in Android App?

查看:14
本文介绍了在Android App中单击按钮时如何打开Gmail Compose?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的 Android 应用程序中单击按钮时打开 Gmail 撰写屏幕.我需要谷歌的一些 API 密钥吗?或者我需要在我的按钮 onClickListener 中做什么?

I am trying to open up Gmail Compose screen when a button is clicked in my Android App. Do I need some API key for this from Google? or what do I need to do in my button onClickListener?

非常感谢任何形式的见解.

Any kind of insight is much appreciated.

推荐答案

不知道你们能不能专门推出gmail.你有没有在你的 onClickListener 中尝试过这个

I don't know that you can specifically launch gmail. Have you tried this in your onClickListener

Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("text/plain");
startActivity(emailIntent);  

您可以在此处找到更多详细信息:Email android intent

You can find more details here: Email android intent

这篇关于在Android App中单击按钮时如何打开Gmail Compose?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆