At first you will think: "Wait, this question is a duplicate!". Read on.
I am trying to use Intent ACTION_SENDTO(with email URI as data) to respond to email requests.
(using it ACTION_SENDlaunches the standard "SEND" selection, without a data URI, which means that no email application, such as Google Drive, is responding).
My problem is that the application works with ACTION_SENDon all devices, however - when using ACTION_SENDTOonly some devices correctly attach files. Nexus 7 works, but the Samsung Galaxy Tab and Acer Iconia do not .
Below you can see the different methods side by side:
String email = getActivity().getResources().getString(R.string.supportEmail);
String subject = getActivity().getResources().getString(R.string.sFeedback);
subject = String.format(subject,
getActivity().getResources().getString(R.string.productName));
String content = getActivity().getResources().getString(R.string.whatFeedbackWouldYouLikeToProvide) + "\n\n" +
mMessage.getText().toString();
File toSend = new File(outfile);
if(toSend.exists()) {
Log.e("Feedback", "File path: " + toSend.getAbsolutePath());
Intent emailIntent = new Intent(android.content.Intent.ACTION_SENDTO);
emailIntent.setData(Uri.parse("mailto:" +email));
emailIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.fromFile(toSend));
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, content);
try {
startActivity(emailIntent);
} catch (ActivityNotFoundException anfe) {
Toast.makeText(getActivity(), getResources().getString(R.string.pleaseInstallAnEmailClientInOrderToSendUsFeedback), 8000).show();
}
}
, , , , , :
Samsung :
04-11 11:40:09.953: E/Feedback(6286): File path: /storage/sdcard0/logs.zip
Nexus :
04-11 11:38:59.249: E/Feedback(12702): File path: /storage/emulated/0/logs.zip
( getExternalStorageDirectory() ).
- , ?