How to open Gmail Compose when a button is clicked in Android App?(在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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在Android App中单击按钮时如何打开Gmail Compose?
基础教程推荐
- NSString intValue 不能用于检索电话号码 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
