-
Android Intent开发实例
Android Intent开发实例 核心代码:package com.amaker.ch06.app;import com.amaker.ch06.app.R;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;import android.widget.EditText;/** * @author 郭宏志 * 发送Email */public class MainActivity extends Activity { // 声明视图组件 private EditText toEditText,subjectEditText,contentEditText; private Button sendBtn; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // 实例化视图组件 toEditText = (EditText)findViewById(R.id.toEditText01); subjectEditText = (EditText)findViewById(R.id.subjectEditText01); contentEditText = (EditText)findViewById(R.id.contentEditText01); sendBtn = (Button)findViewById(R.id.sendButton01); // 为按钮添加单击监听器 sendBtn.setOnClickListener(listener); } // 发送按钮单击监听器 private OnClickListener listener = new OnClickListener() { @Override public void onClick(View v) { // 获得输入信息 String to = toEditText.getText().toString(); String subject = subjectEditText.getText().toString(); String content = contentEditText.getText().toString(); // 创建Intent Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); // 设置内容类型 emailIntent.setType("plain/text"); // 设置额外信息 emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{to}); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, content); startActivity(Intent.createChooser(emailIntent, "发送邮件...")); } };}
- 2014-11-24下载
- 积分:1
-
android RelativeLayout 布局 实例
android RelativeLayout 布局 实例
- 2013-03-16下载
- 积分:1
-
GG-android
这是GGLive的android版本,可以在手机上稳定使用,也是一个即时通(android gglive)
- 2016-12-10 12:47:34下载
- 积分:1
-
android 猜扑克 洗牌小游戏 实例 附完整源码下载
android 猜扑克牌游戏 猜中有鼓励 供大家学习哦
- 2013-03-16下载
- 积分:1
-
android 文件存储 file操作 示例源码下载
android 文件存储 file操作 示例源码下载
- 2014-03-14下载
- 积分:1
-
七自由度汽车模型程序
七自由度汽车模型程序
- 2021-05-06下载
- 积分:1
-
无人机飞控源码
【实例简介】附件中有源码以及制作过程
- 2021-11-10 00:36:06下载
- 积分:1
-
RCGLZJ
android备忘录软件,非常好的例子,很适合初学者学习使用(Memorandum android software, a very good example, it is suitable for beginners to learn to use)
- 2013-11-02 22:15:32下载
- 积分:1
-
android notification 通知示例源码下载
android notification 通知示例源码下载
- 2014-02-16下载
- 积分:1
-
stddef
Test case 241395768 : 1357 3, This is performed three times And for each iteration 9 is performed thrice.
- 2015-10-29 23:29:41下载
- 积分:1