file exists android code example
Example 1: android studio file exist
File dir = getFilesDir();
File file = new File(dir, filename);
if(filename.exists()){
//Do something
}else{
// Do something else.
}
Example 2: android studio file exist
File file = new File(filePath);
if(file.exists()){
//Do something
}else{
// Do something else.
}