📜  列出 dir android 中的所有文件 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:21.483000             🧑  作者: Mango

代码示例1
String path = Environment.getExternalStorageDirectory().toString()+"/Pictures";
Log.d("Files", "Path: " + path);
File directory = new File(path);
File[] files = directory.listFiles();
Log.d("Files", "Size: "+ files.length);
for (int i = 0; i < files.length; i++)
{
    Log.d("Files", "FileName:" + files[i].getName());
}