특정 문서가 첨부 된 전자 메일을 보내는 기능이있는 Android 응용 프로그램을 작성하고 있습니다. 이것은 작동하지만 전자 메일을 첨부 할 때 "peroneal.pdf"라는 첨부 파일 (전자 메일을 수신 할 때 의도 한 것임)이 전자 메일을 받으면 "2131034113.pdf"가됩니다. . 수신 된 문서가 원래 이름을 갖도록 어떻게 변경합니까? 그것은 의도를 명명하는 것과 관련이 있습니까? 그렇다면 어떻게해야합니까? 덕분에 어떤 도움 사전에, 나는 코드를 첨부 :보낸 전자 메일 첨부 파일 이름이 다른 파일과 다릅니다.
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{value.toString()});
i.putExtra(Intent.EXTRA_SUBJECT, "Tendon Email");
i.putExtra(Intent.EXTRA_TEXT , "The info is attached, just hit send.");
String rawFolderPath = "android.resource://" + getPackageName() + "/" + R.raw.peroneal;
Uri emailUri = Uri.parse(rawFolderPath);
i.putExtra(Intent.EXTRA_STREAM, emailUri);
i.setType("application/pdf");
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(PTSlideShow.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}