Email Intent not showing the chooser

前端 未结 2 1230
执笔经年
执笔经年 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: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);
    

提交回复
热议问题