0
send email
画像添付で試しています。書き込み時に添付ファイルが表示されています、ボビーはすべてアフター受信メールで受信者にのみ表示されますsubject & Body
のみアタッチメント私のコードは私のコードでは何がワゴンであるか分かりません。この仕事を終えるために私の提案をお願いします。アタッチメント(画像)付きメールをどう送信するのですか
タイプ1: -
Intent picMessageIntent = new Intent(Intent.ACTION_SEND);
picMessageIntent.setType("image/jpeg");
File downloadedPic = new File(Environment.getExternalStorageDirectory(), strFileName + ".jpg");// Art_Nature
picMessageIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(downloadedPic));//screenshotUri);//Uri.fromFile(new File("downloadedPic"))); //Uri.fromFile(downloadedPic)); // Uri.fromFile(new File("/path/to/downloadedPic")));
startActivity(Intent.createChooser(picMessageIntent, "Share image using"));
タイプ2:
ArrayList<Uri> uris = new ArrayList<Uri>();
Uri u;
Intent picMessageIntent = new Intent(Intent.ACTION_SEND);
picMessageIntent.setType("image/jpeg");
File downloadedPic = new File(Environment.getExternalStorageDirectory(), strFileName + ".jpg");// Art_Nature
if(downloadedPic.exists())
{
Uri u1 = Uri.fromFile(downloadedPic);
uris.add(u1);
picMessageIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
startActivity(picMessageIntent);
}
ここで、eraseContent()とsentmodeとは何か – Aerrow
eraseContent()はプライベートメソッドで、sentModeはフラグです。メールを送信する必要はありません。上記のコードはAndroidプロジェクトのものです。 – Radu
あなたの返信ありがとう – Aerrow