Android 2.1GuessContentTypeFromName not working
<pre><code>String filename = Environment.getExternalStorageDirectory()+"/word.docx";
try{
    File file = new File(filename);
    Uri path = Uri.fromFile(file);
    Intent viewDoc = new Intent(Intent.ACTION_VIEW);
        Log.i(TAG, "mime type "+URLConnection.guessContentTypeFromName(filename).toString());
    viewDoc.setDataAndType(path, URLConnection.guessContentTypeFromName(filename));

    PackageManager pm = getPackageManager();
    List&lt;ResolveInfo&gt; apps = 
        pm.queryIntentActivities(viewDoc, PackageManager.MATCH_DEFAULT_ONLY);

    if (apps.size() &gt; 0){
        startActivity(viewDoc);
    }
}catch(Exception e){
    Log.i(TAG, "oh exception "+e.getMessage());
}
</code></pre>

<p>That is my code and I'm not getting the mime type in Android 2.1, I get null in that Log.</p>

<p>Though, I'll able to get it in the Android 2.3.3 with the same code same app.</p>
