Hi,

I am trying to get Mimetype from extention for .txt file, using below
method:
                    MimeTypeMap map = MimeTypeMap.getSingleton();
                    type = map.getMimeTypeFromExtension(extension);

But the returned type is always "null".

Looking into MimeTypeMap.java code,  in function loadEntry(), I found
below code&msg.
private void loadEntry(String mimeType, String extension,
            boolean textType) {
        ......
        // here, we don't want to map extensions to text MIME types;
        // otherwise, we will start replacing generic text/plain and
        // text/html with text MIME types that our platform does not
        // understand.
        //
        if (!textType) {
            mExtensionToMimeTypeMap.put(extension, mimeType);
        }
    }

Per above codes, all text series extentions (like txt, rtf, text,
vcf...)  can not get Mimetype using the getMimeTypeFromExtension()
function.

Is there any other way to get Mimetype for *.txt or *.vcf file?

Thanks,
ylx
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to