调用系统发邮件的实现
来源:互联网 发布:网络侠客行txt全集下载 编辑:程序博客网 时间:2024/06/05 16:19
XML代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:background="#ffffff"
android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout android:layout_width="fill_parent"
android:id="@+id/feedback" android:layout_height="40dp"
android:background="@drawable/top" android:orientation="horizontal">
<Button android:id="@+id/feedback_cancle" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_marginTop="3dp"
android:text="取消" android:gravity="center" android:layout_marginLeft="10dp"
android:background="@drawable/return_press" />
<TextView android:layout_width="wrap_content"
android:layout_height="50dp" android:text="用户反馈"
android:layout_marginTop="5dp" android:layout_marginLeft="50dp"
android:textColor="#FFFFFF" android:textSize="20sp" />
<Button android:id="@+id/feedback_send" android:layout_width="50dp"
android:layout_height="30dp" android:layout_marginTop="3dp"
android:singleLine="true" android:layout_marginLeft="60dp"
android:gravity="center" android:background="@drawable/send_press" />
</LinearLayout>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="收件人 : "
android:textColor="#000" android:textSize="20dp" />
<EditText android:singleLine="true" android:id="@+id/reciver1"
android:enabled="false" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="mobilecloud@yeah.net" />
</LinearLayout>
<ImageView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="@drawable/line" />
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="抄送/密送 : "
android:textColor="#000" android:textSize="20dp" />
<EditText android:singleLine="true" android:id="@+id/reciver2"
android:enabled="false" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="ihope01@yeah.net" />
</LinearLayout>
<ImageView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="@drawable/line" />
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal">
<TextView android:layout_width="wrap_content" android:layout_marginLeft="5dp"
android:layout_height="wrap_content" android:text="主题 : "
android:textColor="#000" android:textSize="20dp" />
<EditText android:singleLine="true" android:enabled="false"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="用户反馈" />
</LinearLayout>
<ImageView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="@drawable/line" />
<EditText android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@+id/feedbackcontent"
android:gravity="top"/>
</LinearLayout>
JAVA代码
package cn.ihope.mozyhome.Activity;
import java.util.HashMap;
import java.util.Map;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import cn.ihope.mozyhome.service.NetService;
import cn.ihope.mozyhome.util.Cache;
public class SendFeedBackActivity extends Activity {
private Button feedBackCancleButton;
private Button feedBackSendButton;
private EditText feedContent;
private EditText reciver1;
private EditText reciver2;
private String feedBackContent;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 去除title
requestWindowFeature(Window.FEATURE_NO_TITLE);
// 去掉Activity上面的状态栏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.feedback);
feedBackCancleButton = (Button) findViewById(R.id.feedback_cancle);
feedBackCancleButton.setOnClickListener(new FeedBackCancleButtonClickListener());
feedBackSendButton = (Button) findViewById(R.id.feedback_send);
feedBackSendButton.setOnClickListener(new FeedBackSendButtonClickListener());
feedContent = (EditText) findViewById(R.id.feedbackcontent);
reciver1 = (EditText) findViewById(R.id.reciver1);
reciver2 = (EditText) findViewById(R.id.reciver2);
loginName = Cache.user.getLoginName();
mainPath = Cache.mainPath.getMainPath();
}
class FeedBackCancleButtonClickListener implements OnClickListener{
@Override
public void onClick(View v) {
finish();
}
}
class FeedBackSendButtonClickListener implements OnClickListener{
@Override
public void onClick(View v) {
//系统邮件系统的动作为android.content.Intent.ACTION_SEND
Intent intent = new Intent(android.content.Intent.ACTION_SEND);
intent.setType("plain/text");
String[] emailReciver = new String[]{reciver1.getText().toString(), reciver2.getText().toString()};
String emailSubject = "用户反馈";
String emailBody = content.getText().toString();
intent.putExtra(android.content.Intent.EXTRA_EMAIL, emailReciver);
//设置邮件默认标题
intent.putExtra(android.content.Intent.EXTRA_SUBJECT, emailSubject);
//设置要默认发送的内容
intent.putExtra(android.content.Intent.EXTRA_TEXT, emailBody);
//调用系统的邮件系统
startActivity(intent);
}
}
}
- 调用系统发邮件的实现
- Android调用系统的发邮件方法
- Android调用系统的发邮件方法
- 调用系统发邮件的代码
- ios 系统发邮件、短信的实现
- 调用系统程序发邮件
- 调用系统的 打电话 发邮件 发送短信
- 发邮件的实现
- 自动调用系统发邮件功能
- Android 调用系统email程序发邮件
- IPhone之调用系统发邮件模块
- 调用mailer 实现发邮件功能
- java发邮件的实现
- 调用系统的打电话,发短信,系统浏览器,发送邮件的功能
- C#实现调用本地邮件软件发邮件
- zabbix 调用的发邮件脚本
- iOS 调用系统发短信功能的实现
- Android 调用打电话,发短信(彩信),发邮件,浏览器,分享,跳转系统的各个设置页面
- C51---串口通信---虚拟终端模仿
- JavaScript例子1
- 黑马程序员_交通灯系统
- 黑莓手机上的CRM: Salesforce和SugarCRM
- 项目中框架小结
- 调用系统发邮件的实现
- 最简单的flex网络拓扑图开发(一)
- 解决Extjs分页工具条Ext.PagingToolbar无法换页问题
- 用shell脚本分析Nginx日志
- @常用的Linux操作@
- Oracle MAA 说明
- java的method反射机制(二)
- 乱码问题
- notepad++运行网页文件