android - 如何在 android 中通过电子邮件 Intent 从 sd 卡发送 .apk 文件?

标签 android email android-intent

我想通过电子邮件 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/

相关文章:

javascript - 如何使用phonegap获取Android的可折叠 ListView

android - IntelliJ Idea 中的谷歌地图

Android:将 TabHost 与以编程方式创建的 View 一起使用

python-2.7 - 无法登录 gmail - imaplib.error - ALERT 请通过您的网络浏览器登录

android - 获取RecyclerView的选中项位置

android - 怀疑自定义适配器

email - 我的 Drupal 电子邮件设置在哪里?

email - 如何使用 imap 命令获取带有部件号的邮件结构

android - 如何以编程方式打开 Android Play 商店设置页面

android - 如何让正在进行的音频任务继续进行?