0
영어로 죄송합니다. everething 전자 메일 클라이언트에서 잘 작동합니다. 이메일 클라이언트에 파일을 보내고이 메시지를 편집하고 이메일 클라이언트에서 보내면됩니다. 내 코드 벨로Outlook cant는 7 개의 안드로이드에서 PDF 파일을 보내려합니다.
Failed to attach attachments
: 그러나 전망에 내가 오류가
String theme = "Test";
ArrayList<Uri> uris = new ArrayList<>();
for(int i = 0; i < pdfs.length; i++) {
File fileIn = new File(pdfs[i].getAbsolutePath());
fileIn.setReadable(true);
Uri u = Uri.fromFile(fileIn);
uris.add(u);
}
Intent emailIntent = new Intent(ACTION_SEND_MULTIPLE);
emailIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
emailIntent.setType("message/rfc822");
String to[] = {sendTo};
emailIntent.putExtra(EXTRA_EMAIL, to);
emailIntent.putParcelableArrayListExtra(EXTRA_STREAM, uris);
emailIntent.putExtra(EXTRA_SUBJECT, theme);
emailIntent.putExtra(EXTRA_TEXT, context.getResources().getString(R.string.text_email_message_body));
((Activity) context).startActivityForResult(Intent.createChooser(emailIntent, "Choose an Email client:"), 1);
내가 setType
텍스트/일반, 응용 프로그램/octet-stream을, 메시지/RFC822 아무것도 작동 tryed
UPD :
설정 -> 응용 프로그램 -> 응용 프로그램 관리자 -> Outlook -> 사용 권한으로 이동하여 "저장소"를 활성화하십시오 임무를 수동으로하고 에버 리는 일이다. 하지만 내가 어떻게 파일 전망을 보낼 때 나는 automaticaly 권한을 활성화 할 수 있습니까?
여기 https://developer.android.com/training/permissions/requesting.html이 – Kyrmyzyanik
@Kyrmyzyanik, OP가 그것을 필요로하지 않는 봐주십시오 파일을 제공하는 파일 공급자를 사용한다 자신의 앱이지만 외부 앱을위한 것입니다. 다시 읽으십시오. – greenapps