Details
Description
I think indexOf(".") in these code should be lastIndexOf(".")
public static File checkExistsImage(File file) {
if (!file.exists())
imageCount++;
String filePath = imagePath.substring(0, imagePath.indexOf("."));
String type = imagePath.substring(imagePath.indexOf(".") + 1);
file = new File(filePath + "(" + imageCount + ")." + type);
return checkExistsImage(file);
}