如何查看根目录中是否有可用的文件?

时间:2012-01-11 17:10:29

标签: android file directory find root

有人可以在这里发布一些代码,我怎样才能知道某个文件是否可用于此目录:/ sys / class

我用这段代码解决了这个问题:

File file = new File("/path/myfile");
if(file.exists()){
//your code here
}
else{
//your code here
}

1 个答案:

答案 0 :(得分:0)

除模拟器或有根设备外,您无法访问该目录。