Android examples for java.io:File Name
get Filename Extension
public class Main{ public static String getFilenameExtension(String path) { if (path == null) { return null; }/*from w w w .j a va 2 s . c om*/ int sepIndex = path.lastIndexOf("."); return (sepIndex != -1 ? path.substring(sepIndex + 1) : null); } }