What is a good way to get a list of files from (a directory on) the sd card?

前端 未结 3 963
悲哀的现实
悲哀的现实 2020-12-10 06:41

I\'m happy reading and writing to a pre-set file, and could manually populate a listview, but I\'m hoping there is an official(or not) filebrowser I missed, or other more el

3条回答
  •  没有蜡笔的小新
    2020-12-10 07:15

    final String state = Environment.getExternalStorageState();
    if (Environment.MEDIA_MOUNTED.equals(state)) {
    File[] files = Environment.getExternalStorageDirectory().listFiles();
    } else {
    ...
    }
    

提交回复
热议问题