开发者

List files and sub directories Android

开发者 https://www.devze.com 2023-04-08 17:09 出处:网络
What i want to do is to open a directory through android application and list all the files as well as directories present in that directory. I would also like to retrieve permissions and owner inform

What i want to do is to open a directory through android application and list all the files as well as directories present in that directory. I would also like to retrieve permissions and owner information of each file/directory. This can be achieved in ja开发者_如何转开发va but how can i do the same in Android?


The java.io package has been reimplemented within Android. You should be able to use the same mechanisms in Android as you do in Java.

File f = new File("/your/file/path");
File[] files = f.listFiles();
0

精彩评论

暂无评论...
验证码 换一张
取 消