ACTION_VIEW intent for a file with unknown MimeType

后端 未结 13 1656
抹茶落季
抹茶落季 2020-11-27 10:57

My app has a feature that browse files on your phone and SD card and open them using other apps. I want a solution where I don\'t have to specify the MimeType and can work w

相关标签:
13条回答
  • 2020-11-27 12:01

    There is a problem with NoBugs's answer. This is directly out of the eclipse function information window:

    String android.webkit.MimeTypeMap.getMimeTypeFromExtension(String extension)

    public String getMimeTypeFromExtension (String extension)

    Since: API Level 1

    Return the MIME type for the given extension.

    Parameters

    extension A file extension without the leading '.'

    Returns The MIME type for the given extension or null iff there is none.

    0 讨论(0)
提交回复
热议问题