android—Intent发送文本email
来源:互联网 发布:vesa图形编程系统 pdf 编辑:程序博客网 时间:2024/03/29 03:50
代码如下:
import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class MyIntentCaseDemo extends Activity {private Button mybut = null ;// 按钮组件@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);super.setContentView(R.layout.main);// 默认布局管理器this.mybut = (Button) super.findViewById(R.id.mybut) ;// 取得组件this.mybut.setOnClickListener(new OnClickListenerImpl());// 定义单击事件}private class OnClickListenerImpl implements OnClickListener { @Overridepublic void onClick(View view) {Intent emailIntent = new Intent(Intent.ACTION_SEND) ;// 实例化IntentemailIntent.setType("plain/text") ;// 设置类型String address[] = new String[]{"sdu@163.com"} ;// 收件人的地址String subject = "山东大学软件学院(SDU)" ;// 邮件主题String content = "山东大学软件学院(SDU)www.sdu.edu.cn" ;// 邮件内容emailIntent.putExtra(Intent.EXTRA_EMAIL, address) ;// 设置收件人emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject) ;// 设置主题emailIntent.putExtra(Intent.EXTRA_TEXT, content) ;// 设置内容MyIntentCaseDemo.this.startActivity(emailIntent);// 执行Intent}}}
所需权限:
<uses-permission android:name="android.permission.CALL_PHONE"/>
2 0
- android—Intent发送文本email
- Android 使用 Intent 发送 email
- android后台发送Email(不借助Intent)
- Android email intent
- android发送Email
- Androidの发送Email
- 第75章、再识Intent-调用发送Email程序(从零开始学Android)
- Java email (1.简单的文本发送)
- 【Android 开发教程】发送Email
- oracle—email邮件发送
- linux 文本模式下发送带附件email
- Android通过intent发送彩信
- Android中用intent发送邮件
- Android Intent 跳转 发送朋友圈
- Android 之 自制发送 Email 程序
- 【Android】发送Email(内置Gmail和JavaMail)
- Android之调用系统Email发送邮件
- Android调用系统Email发送邮件
- N皇后问题
- 华为机试——五分制成绩:break和continue的区分
- mysql 高级之运算符
- 随笔
- CEditor里鼠标悬停在word上显示对应声明代码的提示框的代码
- android—Intent发送文本email
- C# WinForm多线程开发(二) ThreadPool 与 Timer
- 第七周作业项目---体验常成员函数
- 内存泄露检测—VLD工具
- 机器学习-Random Forest算法简介
- 感冒了
- Spring 3.0参考手册之SpEL
- AnkhSvn安装及使用
- CBuilder6安装后运行报错,打开工程选项崩溃的处理方法—Win 2008R2或Win7