I am trying to open a .MSG file through my application. I tried with setting the MIMETYPE as `vnd.ms-outlook`, still i couldn't able to open up the .MSG file as i expected, then i tried with attaching the same .MSG in email and opened in my device. It opened like a charm.
So my question is , How can i open up the .MSG file in android programmatically within the application.
Tried with following methods,
Method 1 : Setting the MIMETYPE manually
mimetype = "application/vnd.ms-outlook";
Method 2 : Fetching the MIMETYPE through `MimeTypeMap`
String extension = android.webkit.MimeTypeMap.getFileExtensionFromUrl(Uri.fromFile(file).toString());
String mimetype = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
Opening the .MSG file through another installed application
Log.i(TAG, "Extension :" + extension + "\n" + "MIME :" + mimetype);
intent.setDataAndType(Uri.fromFile(file),mimetype);
startActivity(intent);
The mimetype in Method 2 results null and the mimetype set explicitly too doesn't work.
Could anybody share their thoughts on solving this issue.
Thanks.