问题描述
我有一个ListView连接到解析服务器数据通过解析.当我单击ListView的单个项目时,它将转到单个项目视图.那里我有一个电子邮件按钮,我需要的是当我单击该电子邮件按钮,并且电子邮件客户端应打开.具有该特定单个项目的电子邮件ID.电子邮件ID存储在parse数据库中的一列中.有谁知道请致电该怎么做?
I have a ListView connected to parse server data is coming through parse. when I click single item of the ListView it goes to single item view. there i have a button for email , what i need is when I click that email button and email client should open .with that particular single items email id . email id's are stored in a column in parse database . any one knows please tel how to do this ?
我的数据库是解析服务器,我需要从解析列.每个单项都有不同的电子邮件...电子邮件列名称是电子邮件"
my database is parse server , I need to get emails dynamically from aparse column. each singe item has a different email ... email columnname is "email"
*
*
btn1 = (Button)findViewById(R.id.button5);
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String phnoo = object.getString("email");
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setType("message/rfc822");
intent.setData(Uri.parse("mailto:"+phnoo));
startActivity(intent);
btn1 = (Button) findViewById(R.id.button5) ;
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String phno="email";
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri data = Uri.parse("mailto:" +phno);
intent.setData(data);
startActivity(intent);
}
});
<Button
android:id="@+id/button5"
android:layout_width="0dp"
android:layout_height="match_parent"
android:text="E-MAIL"
android:layout_weight="1"
android:background="#EFEFEF"/>
推荐答案
我认为这会对您有所帮助
I think this would help you
Intent in = new Intent(Intent.ACTION_SEND);
in.setType("plain/text");
in.putExtra(Intent.EXTRA_EMAIL, new String[] { "mail id" });
in.putExtra(Intent.EXTRA_SUBJECT, "subject");
in.putExtra(Intent.EXTRA_TEXT, "mail body");
startActivity(Intent.createChooser(in, ""));
这篇关于单击按钮时调用邮件客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!