【问题标题】:Android: File list in ListViewAndroid:ListView中的文件列表
【发布时间】:2012-06-30 16:21:04
【问题描述】:

我需要在 ListView 中做文件列表。文件夹中的文件(.txt 文件)。 我该怎么做?

【问题讨论】:

    标签: java android listview


    【解决方案1】:

    看到这个link

    使用

    File mfile=new File("/sdcard");
    File[] list=mfile.listFiles();
    

    并使用

    循环过滤
    if(name.endsWith(".txt")) { }
    

    How to list all files and folders locating on sd card

    How do I count the number of files with a specific extension on Android?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-10-20
      • 1970-01-01
      • 1970-01-01
      • 2013-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多