My app integrates e-mail where the user can submit a bug report, feedback, etc. from the app directly. I'm using the application/octet-stream as the SetType for the Intent. When you go to submit the e-mail you get the content chooser and it shows various items from Evernote, Facebook, E-mail, etc.
How can I get this chooser to only show E-mail so as not to confuse the user with all these other items that fit the content chooser type?
Thank you.
I am presuming that you are using the
ACTION_SEND
Intent
action, since you did not bother to actually state what you're using, but you agreed with @Aleadam's comment.Nothing in that sentence limits things to email.
ACTION_SEND
is a genericIntent
action that can be supported by any application that wants to. All you do is indicate what data you are sharing and the MIME type of that data -- from there, it is up to the user to choose from available activities.As @Jasoon indicates, you can try
message/rfc822
as the MIME type. However, that is not indicating "only offer email clients" -- it indicates "offer anything that supportsmessage/rfc822
data". That could readily include some application that are not email clients.If you specifically want to send something by email, integrate JavaMail into your app, or write an email forwarding script on your Web server and invoke it, or something. If you use
ACTION_SEND
, you are implicitly stating that it is what the user wants that matters, and you want the user to be able to send such-and-so data by whatever means the user chooses.There is a way more generic to do that, working with any MIME type.
See this post: How to customize share intent in Android?