如何打开包含 android 中的子目录的目录?

How to open a directory which contains subdirectory in android?

我可以打开 android 挂载在 sdcard 上的目录应该包含子目录。 例如,在 ashish 目录中,我有 talasu 和 ash 子目录。 我的代码 return :-

 String root = Environment.getExternalStorageDirectory().toString();

 File file = new File(root + "/ashish");

是的,您可以访问目录,这里有一些代码可以帮助您

     File[] c = f.listFiles();//where f is your root directory(ashish)
   if (c != null) {
       for (int i = 0; i < c.length; i++) {
           if (c[i].isDirectory()) {
               //do whatever you want to do with subdirectories
           }