Android Mime Type Get getMimeType(String url)

Here you can find the source of getMimeType(String url)

Description

get Mime Type

Declaration

public static String getMimeType(String url) 

Method Source Code

//package com.java2s;

import android.webkit.MimeTypeMap;

public class Main {
    public static String getMimeType(String url) {
        String type = null;//  ww  w  . jav a  2s. co m
        String extension = MimeTypeMap.getFileExtensionFromUrl(url);
        if (extension != null) {
            MimeTypeMap mime = MimeTypeMap.getSingleton();
            type = mime.getMimeTypeFromExtension(extension);
        }
        return type;
    }
}

Related

  1. getMimeType(byte[] bytes)
  2. isRotationSupported(String mimeType)
  3. isSupportedByRegionDecoder(String mimeType)
  4. getMIMEType(String fName)
  5. guessMime(String path)