我想通过EXTRATEXT intent...But发送多个值,但我做不到。
代码:
public void onClick(View view) {
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
String mailid="luckshay_sm@yahoo.co.in";
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{mailid});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Delivery Request");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "My address is "+edittext.getText().toString());
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "My phone number is "+edittext1.getText().toString());
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
}
});
Now the problem is that only phone number appears but the address doesnt appear..ie. its taking the second EXTRA_TEXT and not the first one.:(我想用EXTRA_TEXT....Is传递一些5-6的值,这是可能的吗?
发布于 2011-04-14 13:46:50
如果你使用2 (android.content.Intent.EXTRA_TEXT),它会取最后一个。因此,您可以使用下面的地址和电话号码代码作为putextra
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "My address is "+edittext.getText().toString()+"\n My phone number is "+edittext1.getText().toString()); https://stackoverflow.com/questions/5659000
复制相似问题