is file name having Image Extension - Android android.graphics

Android examples for android.graphics:Image

Description

is file name having Image Extension

Demo Code


public class Main{

    public static boolean isImageExtension(String path) {
        String extension = getFilenameExtension(path);
        if (extension.equals(".png"))
            return true;
        if (extension.equals(".jpg"))
            return true;
        if (extension.equals(".jpeg"))
            return true;
        if (extension.equals(".gif"))
            return true;
        return false;
    }/*w w w  . ja  va 2  s .  c o m*/

}

Related Tutorials