Android 按钮 onclick 提交到电子邮件
我使用 Java 和 Xml 已有几个月了,感谢 StackOverflow 上大家的帮助,我学到了很多东西。
我的问题是关于与提交按钮相关的android java 编程。
目前我正在尝试弄清楚如何向电子邮件地址提交值(在幕后)
假设我们有一个文本字段和一个按钮;我想获取在文本字段中输入的值,并将其提交到 onclick 的电子邮件地址。
我无法在网上找到任何可以告诉我如何执行此操作的内容。
预先感谢您阅读我的帖子,并期待您的建议。
I have been working with Java and Xml for a few months now, and have learned a great deal thanks to everyones help on StackOverflow.
My question is about java programming for android in relation to the submit button.
Currently I am trying to figure out how to submit a value to an email address (behind the scenes)
Lets say we have a text field and a button; I want to take the value entered in the text field, and submit that to an email address onclick.
I am unable to find anything online that shows me how to do this.
Thank you in advance for reading through my post and I look forward to your suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是一个很好的例子,说明如何使用
Intents
非常方便!Android 有一堆预定义的 Intent,可以在系统内执行某些操作;您之前可能点击过某张图片,然后会弹出一个对话框,询问您是否要在图库中或在 Astro 等第三方应用程序中查看它。图像的观看有其自身预先确定的意图。
发送电子邮件也有其自己预先确定的意图:
android.content.Intent.ACTION_SEND
。您需要使用该属性创建一个意图,然后附加额外信息(即要发送到的地址、主题/消息正文等)。示例代码:
我希望这有帮助!
您可能想查看的一些来源:
http://developer.android.com/guide/topics/intents/intents -filters.html
http://developer.android.com/reference/android/content/Intent .html#ACTION_SEND
This is a great example of how using
Intents
can come in great handy!Android has a bunch of pre-defined Intents that do certain things within the system; you may have clicked on a picture before and a dialog popped up asking whether you would like to view it in your gallery or in a third-party app such as Astro. The viewing of an image has its own pre-determined intent.
Sending an email also has its own pre-determined intent:
android.content.Intent.ACTION_SEND
. You'll need to create an intent with that property and then attach extra information (ie. the address to send to, the subject/message body, etc.).Example code:
I hoped this helped!!
Some sources you might like to check out:
http://developer.android.com/guide/topics/intents/intents-filters.html
http://developer.android.com/reference/android/content/Intent.html#ACTION_SEND
试试这个
try this
效果很好
It works good