我对发送邮件这样的代码:安卓:附加文件到邮件
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"[email protected]"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT , "body of email");
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(BladeActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
如何连接到该邮件文件:/sdcard/MyFile.csv
感谢,
感谢您的帮助! – Gold 2012-04-17 06:18:57
不客气:) – fardjad 2012-04-17 06:20:58
永远不要使用固定路径'/ sdcard /',因为例如我的SD卡路径是'/ mnt/sdcard' – 2012-04-17 08:20:59