android check file extension

82

android check file extension -

//if you have the path
String someFilepath = "image.fromyesterday.test.jpg"; 
String extension = someFilepath.substring(someFilepath.lastIndexOf("."));

//direct with file
String extension = ff.getAbsolutePath().substring(ff.getAbsolutePath().lastIndexOf("."));

Comments

Submit
0 Comments