I was searching for how to I can identify or check if the file selected by the user is an Image (eg of extension: .jpg or .png or .bmp and more). Note that the image is not just one file it's list of images.
I've tried this code:
final File folder = new File( oo );
final File[] listOfFiles = folder.listFiles();
ImageView imageView = new ImageView();
String mimeType = new MimetypesFileTypeMap().getContentType( folder );
String type = mimeType.split( "/" )[0].toLowerCase();
if ( !type.equals( "image" ) ) {
//TODO
}
else {
//TODO
}
After trying that code nothing changed i still get the problem. How i can do so and thanks a lot :-)