0
我試圖將SD卡上的圖像附加到電子郵件中(從我的應用程序到Gmail應用程序)。如何將SD卡上的圖像附加到電子郵件中?
每次嘗試時,我都會選擇Gmail應用程序,然後關閉,它不附加文件。
假設圖像路徑爲:/sdcard/DCIM/Snapseed/Snapseed4.jpg
。這是我用來發送電子郵件的代碼:
Intent emailintent2 = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
emailintent2.setType("image/*");
emailintent2.putExtra(Intent.EXTRA_EMAIL, emailaddress2);
emailintent2.putExtra(Intent.EXTRA_SUBJECT, CorAsunto);
emailintent2.putExtra(Intent.EXTRA_TEXT, message2);
Uri uris = Uri.fromFile(new File(Environment.getExternalStorageDirectory()
+ "/DCIM/Snapseed/Snapseed4.jpg"));
emailintent2.putExtra(Intent.EXTRA_STREAM, uris);
startActivity(emailintent2);
你能提供的logcat的? – 2013-03-06 21:33:51