code: public static String getExtension(String uri) {
          if (uri == null) {
              return null;
          }
  
          int dot = uri.lastIndexOf(".");
          if (dot >= 0) {
              return uri.substring(dot);
          } else {
              // No extension.
              return "";
          }
      }
docs: Gets the extension of a file name, like ".png" or ".jpg".
  
  @param uri
  @return Extension including the dot("."); "" if there is no extension;
  null if uri was null.