2011-08-25 80 views

回答

1
File myFile = new File("/path/to/file"); 
if (myFile.isFile()) { 
    ... 
} 
+0

由于格雷厄姆的Borland – Mak

+1

myFile.exists()是redunant到ISFILE – berlindev

+0

@Animated钟:所以,谢谢。现在修复。 –

0

如果您已经创建使用openFileOutput方法的文件,则该作品

File mFile = new File(getBaseContext().getFilesDir(),FileName); 
if (mFile.exists()) 
{ 
    //File is Exits. 

} 
else 
{ 
//File is not Exits. 
} 

希望这有助于

相关问题