我想通过电子邮件 Intent 从 SD 卡发送 .apk 文件,但没有收到附件。
请参阅下面的代码我尝试此代码但不适合我..
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
new String[] { "email id" });
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
"Test Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
"go on read the emails");
Log.v(getClass().getSimpleName(),
"sPhotoUri=" + Uri.parse("file:/" + "/sdcard/obb/rr.apk"));
emailIntent.putExtra(Intent.EXTRA_STREAM,
Uri.parse("file:/" + "/sdcard/obb/rr.apk"));
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
此代码表示无法附件且无法收到邮件。
最佳答案
尝试如下更改附件类型:
emailIntent.setType("application/zip");
关于android - 如何在 android 中通过电子邮件 Intent 从 sd 卡发送 .apk 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25541975/