title: how to get mime type of a file,which has dot in the file name on android
body: <p>i get mime type of a file using the following code:</p>
  
  <pre><code>    private String getMimeType(String url) {
  
          String type = null;
          String extension = MimeTypeMap.getFileExtensionFromUrl(url);
          Log.e("extension ", extension);
  
          if (extension != null) {
          MimeTypeMap mime = MimeTypeMap.getSingleton();
          type = mime.getMimeTypeFromExtension(extension);
          }
          return type;
      }
  
     where url is the absolute file path
  
      i am getting file and folder by the following way
      File file_arr [];
      file_arr = new   File(Environment.getExternalStorageDirectory().getPath()).listFiles();
      url = file_arr[i].getAbsolutePath();
  </code></pre>
  
  <p>this is working correct but it <strong>return always null  for which file has dot " . "</strong> in its file name.</p>
  
  <p>for the example</p>
  
  <p>if the file name is <strong>picture1.jpg</strong> then the getMimeType() return <strong>image/jpeg</strong></p>
  
  <p>in the case of file name has dot (.) in its name for the example <strong>27-05-2012 22.05.14.jpg</strong> then the getMimeType() return null. </p>
  
  <p>i have renamed the file to 27-05-2012.jpg, its return image/jpeg.</p>
  
  <p>my question how to get mime type for all types of file name(which is has dot or special character) on android? please help me. </p>