急!!!! 跪求查找所有包含图片文件(png,jpg,gif,bmp==)的目录 在android里面想弄个图片的应用但是每次系统媒体库的图片都不能及时更新,所以改用自己去搜索SDCARD的图片文件,具体实现目标:查找所有包含图片文件的目录 可以是C/C++/java实现的方法 最好最好用C++/C的方法实现 实现思路/代码都可以 在此谢谢各位大侠了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个试过可以搜索 public void SearchFiles(File file) { if(file==null) return; File[] files = file.listFiles(); if(files==null) return; for (File mf : files) { if (mf.isDirectory()) { System.out.println(mf.getPath()); SearchFiles(mf); } else { if(file==null) continue; try { String str=mf.getName().toLowerCase(); if (str.endsWith(".bmp") ||str.endsWith(".png") ||str.endsWith(".jpg") ||str.endsWith(".gif") ) { System.out.println(mf.getPath()); } } catch(Exception e) { e.printStackTrace(); } } } }; SearchFiles(new File("/sdcard")); flex4中调用摄像头时出现雪花点 android如何使用syncML来同步通讯录 再次质疑Android回退键不推出程序的设计 keystore问题。 关于surfaceview的一些问题 求推荐几个开源的游戏,认真学习学习 如何使用纯代码实现不带图片的radiobutton? android客户端通过webservice获取数据库图片 adb logcat命令行如何查看某个进程的log信息? (已知进程的ID 和 有APK应用的源码) 请问app 做 ktv中的 评分 有什么方案实现,如唱吧、全民k歌评分 关于点击button的算法 急求:通过wifi广播消息?
if(file==null) return;
File[] files = file.listFiles();
if(files==null) return;
for (File mf : files) {
if (mf.isDirectory()) {
System.out.println(mf.getPath());
SearchFiles(mf);
} else {
if(file==null) continue;
try {
String str=mf.getName().toLowerCase();
if (str.endsWith(".bmp") ||str.endsWith(".png") ||str.endsWith(".jpg") ||str.endsWith(".gif") )
{
System.out.println(mf.getPath());
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
}; SearchFiles(new File("/sdcard"));