开发者

how to access the files in a directory

开发者 https://www.devze.com 2023-01-02 23:19 出处:网络
hii am new to and开发者_运维百科roid programming, can someone please tell me how to get access to the files in a directory , i am using Environment.getExternalStorageDirectory() method?That method jus

hi i am new to and开发者_运维百科roid programming, can someone please tell me how to get access to the files in a directory , i am using Environment.getExternalStorageDirectory() method?


That method just returns a java.io.File, so you should be able to get the files using the standard Java methods:

 String[] list(); //Returns an array of strings with the file names in the directory represented by this file.
 String[] list(FilenameFilter filter); //Gets a list of the files in the directory represented by this file.
 File[] listFiles(FileFilter filter); //Gets a list of the files in the directory represented by this file.

( http://developer.android.com/reference/java/io/File.html )

0

精彩评论

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