如何从SD卡中的android找到的MP3文件编程 [英] How to find mp3 files from sdcard in android programatically
本文介绍了如何从SD卡中的android找到的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.
感谢U
推荐答案
当然。您可以 。 code未经测试。
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");
}
});
}
这篇关于如何从SD卡中的android找到的MP3文件编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文