In my Android app, I am sending emails with attached images.
Using the Intent system to submit it, I can do one of the following two things:
1) Specify the type as "message / rfc822" so that ONLY email applications are displayed in Chooser.
Inconvenience: I cannot specify the mime type of the image I am attaching using EXTRA_STREAM and Uri. Many receiving email applications (Gmail, Android, etc.) show this as an unknown blob attached to a message, donβt know how to view it, and donβt know how to open it as an attachment.
2) Specify the type as (say) "image / png". The image is attached, and email clients such as Gmail can view it and open the attachment in the corresponding application.
Inconvenience: for the sending user, I cannot reduce the list of applications that the user must select in Chooser to send email applications, and MANY applications appear on my Android device, most of which are not email applications, and not what I want .
Is it possible to specify his email address "message / rfc822" And specify the MIME type of data connected via Uri in Intent.EXTRA_STREAM?
BTW: I provide a file from my own ContentProvider, and the getType () method (used to determine the type of the MIME file) is NOT called. The query () method, but does not query the file type, displays only the name and size of the file.
thanks
source share