如何以编程方式在android中从sdcard中查找mp3文件 [英] How to find mp3 files from sdcard in android programatically
本文介绍了如何以编程方式在android中从sdcard中查找mp3文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是 android 编程的新手,所以任何人都可以帮我找到我的 android 设备中的所有 .mp3 文件.
I am new to android programming so can anyone please help me to find all .mp3 files in my android device.
推荐答案
当然.你可以 .代码未经测试.
Of course . you can . Code not tested.
File dir =new File(Environment.getExternalStorageDirectory());
if (dir.exists()&&dir.isDirectory()){
File[] files=dir.listFiles(new FilenameFilter(){
@Override
public boolean accept(File dir,String name){
return name.contains(".mp3");
}
});
}
这篇关于如何以编程方式在android中从sdcard中查找mp3文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文