How do I display a list of all MIME types supported by a given Android device?

放肆的年华 提交于 2019-12-04 20:15:00

Here is the full list : https://www.iana.org/assignments/media-types/media-types.xhtml

It is referenced in the android documentation here: https://developer.android.com/guide/topics/providers/content-provider-creating.html#MIMETypes

Note that these MIME types are supported only if the user has the appropriate app for it. I don't think that you can display the supported MIME types programmatically. However you can check if the one that you want to use is supported using code like this :

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(someUri, "YOUR_MIME_TYPE_HERE");
if(intent.resolveActivity(activity.getPackageManager()) != null)
{
    lActivity.startActivity(intent);
}
else
{
    Log.w(TAG, "There is no application for this MIME type");
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!