Custom mime type ignored in GMail app

狂风中的少年 提交于 2019-12-05 22:44:30

Unfortunately, there is not much you can do. Some email apps, for god knows what reason, incorrectly set the mime type for custom files, to octet-stream. Your best shot is to set your custom mime type, but then, on the receiving end, make sure you also accept octet-stream. Then, you will need to check the file extension to make sure it is indeed your file, and not something else, not intended for your app (I am assuming you are also using a custom extension).

please check this code snippet

final Intent emailIntent = new Intent(Intent.ACTION_SEND); 
emailIntent.setType("text/plain"); 
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{"webmaster@website.com"}); 
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "my subject"); 
emailIntent.putExtra(Intent.EXTRA_TEXT, "body text"); 
context.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!