Get filenames from a directory in Android

前端 未结 6 1816
日久生厌
日久生厌 2021-01-17 15:43

I want to populate a spinner with the filenames of files found on the SD card with specific extensions. I can get it thus far to populate the spinner with the correct files,

6条回答
  •  -上瘾入骨i
    2021-01-17 16:27

    File filePath= new File(File Address);
    File[] fileList = filePath.listFiles();
    String name = fileList [0].getName().toString();
    

提交回复
热议问题