Email Intent not showing the chooser

前端 未结 2 1221
执笔经年
执笔经年 2020-12-20 06:54

I\'m using the following to initiate the sending of an email:

Intent i = new Intent(Intent.ACTION_SEND);
i.setType(\"message/rfc882\"); 
i.putExtra(Intent.EX         


        
相关标签:
2条回答
  • 2020-12-20 07:09

    It might not respond to message/rfc882 Intents. Try text/plain instead, if you can, as I'm pretty sure that works.

    0 讨论(0)
  • 2020-12-20 07:19

    It's a common misconception to use text/plain. This will trigger any application that can handle plain text files without any context, including Google Drive, Dropbox, Evernote and Skype.

    Instead use a ACTION_SENDTO, providing the mailto: Uri:

    intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:"));
    startActivity(intent);
    
    0 讨论(0)
提交回复
热议问题