첨부 파일이있는 이메일을 보내려고합니다. 내부 저장 장치의 파일은, 그래서 이것은 내 코드입니다 :첨부 파일이있는 Android 용 이메일을 보내려면 어떻게해야합니까?
File filelocation = new File(getFilesDir().getAbsolutePath()+"/MyApp", "FileName");
Uri path = Uri.fromFile(filelocation);
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent .setType("vnd.android.cursor.dir/email");
String to[] = {"[email protected]"};
emailIntent .putExtra(Intent.EXTRA_EMAIL, to);
emailIntent .putExtra(Intent.EXTRA_STREAM, path);
emailIntent .putExtra(Intent.EXTRA_SUBJECT, "Subject");
startActivity(Intent.createChooser(emailIntent , "Send email..."));
하지만 난 항상 얻을 : Permission denied for file
합니다.
어떻게 해결할 수 있습니까 ?? 매니페스트
에 읽기 권한을 추가 한
Gmail은 5.0 만 외부 저장 http://stackoverflow.com/questions/26883259/gmail-5-0-app-fails-with-permission-denied-for-the-attachment-when에서 파일을 받아 - 받음 –