@DrawableRes
    public static int getMimeTypeIcon(@Nullable final String mimeType) {

        if (mimeType == null) {
            return R.drawable.ic_menu_file;
        }
        if (mimeType.contains("spreadsheet")) {
            return R.drawable.ic_menu_file_sheet;
        }
        if (mimeType.contains("pdf")) {
            return R.drawable.ic_menu_file_pdf;
        }
        if (mimeType.startsWith("text/")) {
            return R.drawable.ic_menu_file_doc;
        }
        return R.drawable.ic_menu_file;
    }
Utility class prvoding helper methods when dealing with Uris
main/src/main/java/cgeo/geocaching/utils/UriUtils.java