[英]how can i list and choose all audio files in the device?
I'm looking forward to find an activity that can list and than choose all file of a certain type... this is qhat i have: 我期待找到一个活动,该活动可以列出,而不是选择某种类型的所有文件……这是我所拥有的:
File dir = new File(".");
String[] names = dir.list(new FilenameFilter(){
public boolean accept(File dir, String name)
{
return name.endsWith(".mp3");
}
});
until this moment it can only list the file of a certain extension. 直到这一刻,它只能列出某个扩展名的文件。 how can i use this list to make a file choose?
我如何使用此列表来选择文件? and how can i include in this list all audio file and not only .mp3?
以及如何在此列表中包括所有音频文件而不仅仅是.mp3? it would be great to find a library that do so...
很高兴找到一个这样做的图书馆...
If you want to create a file explorer than there is a Open source sample. 如果要创建文件资源管理器,则可以使用开源示例。 This open source will only show you folders and files with extension you are willing to search
这个开放原始码只会显示您愿意搜寻的具有副档名的资料夹和档案
Below is the URL for the same: 以下是相同网址:
Android File Dialog Android文件对话框
This might solve your problem. 这可能会解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.