특정 폴더의 모든 MP3 파일 목록을 가져 오는 방법은 무엇입니까?특정 폴더의 MP3 파일 목록 - Android
내 폴더
FILE_PATH = Environment.getExternalStorageDirectory().getPath() + "/my folder/"
이 다음 코드 쇼는 내가 목록을 가져올 내 폴더에만
Cursor createCursor(String filter) {
ArrayList<String> args = new ArrayList<String>();
String selection;
if (mShowAll) {
selection = "(_DATA LIKE ?)";
args.add("%");
} else {
selection = "(";
for (String extension : CheapSoundFile.getSupportedExtensions()) {
args.add("%." + extension);
if (selection.length() > 1) {
selection += " OR ";
}
selection += "(_DATA LIKE ?)";
selection = selection + "AND (IS_MUSIC=1)";
}
selection += ")";
selection = "(" + selection + ") AND (_DATA NOT LIKE ?)";
args.add("%espeak-data/scratch%");
}
if (filter != null && filter.length() > 0) {
filter = "%" + filter + "%";
selection =
"(" + selection + " AND " +
"((TITLE LIKE ?) OR (ARTIST LIKE ?) OR (ALBUM LIKE ?)))";
args.add(filter);
args.add(filter);
args.add(filter);
}
하나가 있습니까? 나를 도와 줄 수 있니? – Mullinsangebn
이것을 확인하십시오 : http://stackoverflow.com/questions/17210519/how-to-access-all-mp3-files-from-all-the-subfolders-in-the-sdcard – kedark
예, 작동하지만 저는 모릅니다. 내 코드로 할 ... – Mullinsangebn