安卓:在ListView的文件列表 [英] Android: File list in ListView

查看:152
本文介绍了安卓:在ListView的文件列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I need do the file list in ListView. Files from the folder (.txt files). How can I do it?

推荐答案

看到这样的链接

使用

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

和使用环路滤波器

if(name.endsWith(".txt")) { }

<一个href=\"http://stackoverflow.com/questions/8638293/how-to-list-all-files-and-folders-locating-on-sd-card\">How列出所有文件,并定位在SD卡上的文件夹

<一个href=\"http://stackoverflow.com/questions/5058934/how-do-i-count-the-number-of-files-with-a-specific-extension-on-android\">How我算的文件的数量与Android特定扩展名?

这篇关于安卓:在ListView的文件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆