开发者

how to access the files in a directory

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜