Try original and inferred MIME type to find best viewer for attachment
In order for Android to find apps that are capable of opening an attachment for viewing the ACTION_VIEW Intent needs to contain an appropriate MIME type. Ideally, we'd use the MIME type specified for the attachment in the message. But often the supplied MIME type is wrong/useless. So we look at the file extension to try to come up with a sensible MIME type on our own. We then go on to ask Android which of the two MIME types leads to more apps claiming to be able to open our attachment for viewing and use that one.
Loading
Please register or sign in to comment