SendMail.java view source print ?
01 package org.apache.android.mail;
02
03 import android.app.Activity;
04 import android.os.Bundle;
05 import android.util.Log;
06 import android.view.View;
07 import android.widget.Button;
08 import android.widget.EditText;
09
10 public class SendMail extends Activity {
11 /**
12 * Called with the activity is first created.
13 */
14 @Override
15 public void onCreate(Bundle icicle) {
16 super.onCreate(icicle);
17 setContentView(R.layout.main);
18 final Button send = (Button) this.findViewById(R.id.send);
19 final EditText userid = (EditText) this.findViewById(R.id.userid);
20 final EditText password = (EditText) this.findViewById(R.id.password);
21 final EditText from = (EditText) this.findViewById(R.id.from);
22 final EditText to = (EditText) this.findViewById(R.id.to);
23 final EditText subject = (EditText) this.findViewById(R.id.subject);
24 final EditText body = (EditText) this.findViewById(R.id.body);
25 send.setOnClickListener(new View.OnClickListener() {
26 public void onClick(View view) {
27 GMailSender sender = new GMailSender(userid.getText().toString(),
28 password.getText().toString());
29 try {
30 sender.sendMail(subject.getText().toString(),
31 body.getText().toString(),
32 from.getText().toString(),
33 to.getText().toString());
34 } catch (Exception e) {
35 Log.e("SendMail", e.getMessage(), e);
36 }
37 }
38 });
39 }
40 }

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android裁剪图片总结
  2. 解决Glide4.0和圆角裁剪CenterCrop冲突
  3. android webview 使用js加载json文件失败
  4. Android下相机的调用
  5. android notification 的总结分析
  6. Android(安卓)Scroll 详解
  7. android 设置 button 不同状态的图片
  8. 2010.12.29(2)——— android GridView
  9. 解决问题:Could not find method android(
  10. 关于Android studio的build.gradle的内容